Transition between these two forms of equations describing an ellipse

analytic geometryconic sections

I do not know the names of these two forms, so call the first one axis vector form and the second one parametric form. The axis vector form I found here. It uses the orthogonal vectors $\vec{a}$ and $\vec{b}$ of the major and minor axis to span the ellipse shape $P$:

$$
P = C + \vec{a} \cdot cos(\alpha) + \vec{b} \cdot sin(\alpha), \space 0 \leqslant \alpha< 2\pi
$$

By breaking down the points and vectors into their components in cartesian coordinates (for $x$, $y$ and $z$ look the same)

$$
P_x = C_x +a_x \cdot cos(\alpha) + b_x \cdot sin(\alpha)
$$

and defining

$$
sin(\varphi_x) = a_x \cdot \sqrt{a_x^2 + b_x^2}\\
cos(\varphi_x) = b_x \cdot \sqrt{a_x^2 + b_x^2}
$$

we arrive at

$$
P_x = C_x +\sqrt{a_x^2 + b_x^2} \cdot \left ( sin(\varphi_x)\cdot cos(\alpha) + cos(\varphi_x) \cdot sin(\alpha) \right) \\
\Leftrightarrow P_x = C_x +\sqrt{a_x^2 + b_x^2} \cdot sin(\alpha + \varphi_x),
$$

where $\hat{A_x} = \sqrt{a_x^2 + b_x^2}$ is the magnitude and $\varphi = atan2(sin(\varphi_x), cos(\varphi_x))$ is the phase

All three dimensions put together give us what I call the parametric form

$$
P = C + \vec{\hat{A}}\cdot sin(\vec{\varphi}) .
$$

Lissajous figures are of the same form.

While the transformation from axis vector form to parametric form is unproblematic, the inverse transform from parametric to axis vector form is not as obvious to me. Numerically it is straight forward to calculate $\vec{\hat{A}}$ and $\vec{\varphi}$ from $\vec{a}$ and $\vec{b}$, and with those same values calculate the inverse and obtain $\vec{a}$ and $\vec{b}$ again with

$$
a_x = \hat{A_x} \cdot sin(\varphi_x)\\
b_x = \hat{A_x} \cdot cos(\varphi_x).
$$

However the phase shift of $\varphi$ is arbitrary, and I didn't manage to find a way to identify this phase shift to make the inverse transform work reliably.

I tried to use the fact that $\vec{a}$ and $\vec{b}$ are orthogonal, and that
$$
\begin{pmatrix}
a_x\\
a_y\\
a_z
\end{pmatrix} \cdot \begin{pmatrix}
b_x\\
b_y\\
b_z
\end{pmatrix} = 0 \\
\Leftrightarrow \begin{pmatrix}
\hat{A_x}\cdot sin(\varphi_x)\\
\hat{A_y}\cdot sin(\varphi_y)\\
\hat{A_z}\cdot sin(\varphi_z)
\end{pmatrix} \cdot \begin{pmatrix}
\hat{A_x}\cdot cos(\varphi_x)\\
\hat{A_y}\cdot cos(\varphi_y)\\
\hat{A_z}\cdot cos(\varphi_z)
\end{pmatrix} = 0
$$

but without success.

I am mostly interested in a solution for the inverse transform in three dimensions. Even a numerical one would be nice, but a general one would be prefered.

Best Answer

Let $$ \vec\varphi=(t+\alpha,\ t+\beta,\ t+\gamma). $$ (Note that $\alpha$ here is only an arbitrary phase, while $t$ is the parameter). Then: $$ s=(P-C)^2=A_x^2\sin^2(t+\alpha)+A_y^2\sin^2(t+\beta)+A_z^2\sin^2(t+\gamma) $$ and $$ {ds\over dt}=A_x^2\sin2(t+\alpha)+A_y^2\sin2(t+\beta)+A_z^2\sin2(t+\gamma). $$ We can find maxima and minima of $s$ from $ds/dt=0$, which gives: $$ A_x^2(\sin2t\cos2\alpha+\cos2t\sin2\alpha) +A_y^2(\sin2t\cos2\beta+\cos2t\sin2\beta) +A_z^2(\sin2t\cos2\gamma+\cos2t\sin2\gamma)=0. $$ Dividing that by $\cos2t$ one obtains: $$ \tan2t=-{A_x^2\sin2\alpha+A_y^2\sin2\beta+A_z^2\sin2\gamma \over A_x^2\cos2\alpha+A_y^2\cos2\beta+A_z^2\cos2\gamma}. $$ From there you can compute two solutions: $t_1$ and $t_2=t_1+\pi/2$, which substituted into the equation for $P-C$ will give vectors $\vec a$ and $\vec b$.

Related Question