Re: don't understand how rotation is done
Posted by dxli on Jun 07, 2013; 3:01pm
URL: https://forum.librecad.org/don-t-understand-how-rotation-is-done-tp5708244p5708246.html
2D rotation around origin can be down equivalently by:
1, angle;
2, unit complex number (vector);
3, matrix;
3D rotation around origin is trickier, but can be rotated equivalently by:
1, axis-angle;
2, unit quaternion; (vector)
3, matrix;
to rotate a complex by a unit complex number:
z= x + i y;
angleVector = cos t + i sin t;
rotate z by angleVector using multiplication of complex number:
(x + i y) ( cos t + i sin t) = x cos t - y sin t + i ( x sin t + y cos t)
to rotate around any point P, simply translate P to origin, do rotation around origin, translate back by -P, something like conjugate,
Translate(P)^-1 Rotate(angle) Translate(P)
forgot to answer on ellipse angle:
ellipse angle is the angle used in parametric equation of ellipse, namely,
x = a cos t
y = b sin t
and the angle t is called ellipse angle, which is related to the actual angle of the point by:
tan(angle)=x/y = a/b tan(t)