[Math] Computing a matrix to convert an (x,y) point on an ellipse to a circle

circlesconic sections

I have an ellipse defined by its semi-major axis, inclination, and position angle. The ellipse is centered on the origin.

I would like to solve for a matrix that converts this ellipse to a circle.

Hence if I have (x,y) on this ellipse, I need to convert it to (x', y') on a circle.

It is not straightforward to set x' = x and y' = y cos (inclination) because the ellipse semi-major and semi-minor axes are not collinear with the X- and Y- axes but are inclined by the position angle.

Best Answer

"Inclination" here seems to be connected with the angle $i$ at which a cone is intercepted by a plane to produce the ellipse, but I'm not familiar with the term. At any rate the OP says (see Comment above) that the semi-minor axis can be expressed as $b = a \cos i$. In what follows, we assume this has been done.

Confusion arises from the subsequent wording that "the ellipse semi-major and semi-minor axes are not collinear with the X- and Y- axes but are inclined by the position angle." Notation for this position angle is not provided in the Question, so let's supply it here, and in doing so let's refer instead to it as the angle of rotation $\alpha$. Specifically, since the ellipse is "centered on the origin", we define $\alpha \in [-\pi/2,\pi/2]$ to be the angle between the semi-major axis and the positive X-axis.

More concretely: the endpoints of the major axis, centered as they are on the origin, are expressed by:

$$ \pm a (\cos \alpha, \sin \alpha) $$

The first step is then "unrotation" by this angle of rotation, a linear transformation on Cartesian coordinates expressed by the following matrix multiplication:

$$ \begin{bmatrix} \cos \alpha & \sin \alpha \\ -\sin \alpha & \cos \alpha \end{bmatrix} \begin{bmatrix} X \\ Y \end{bmatrix} $$

Clearly applying this transformation to the endpoints of the major axis (see above) will map them to $( \pm a, 0)$, thereby putting both major and minor axes in line with the $X$- and $Y$-coordinate axes, respectively.

In this "standard position" the ellipse can easily be transformed into a circle by scaling the X- or Y-coordinate or both. E.g. the mapping $(X,Y) \rightarrow (bX,aY)$ will produce a circle of radius $ab$ by scaling both coordinates. Combining these operations gives a matrix multiplication:

$$ \begin{bmatrix} X' \\ Y' \end{bmatrix} = \begin{bmatrix} b\cos \alpha & b\sin \alpha \\ -a\sin \alpha & a\cos \alpha \end{bmatrix} \begin{bmatrix} X \\ Y \end{bmatrix} $$ Optional: Further equal scaling of both coordinates by a nonzero factor will change the radius accordingly (but preserve circularity) and might be desirable if a particular radius is desired.

Finally this circle may itself be rotated around the origin through any angle, using a linear transformation similar to the "unrotation" described above. However this step is unnecessary if the goal was merely to map the original ellipse to a circle.