Saturday, June 30, 2018

Rotation of ellipse

Today I will share with you about rotation of ellipse.The reason I've chosen this topic is that I frequently face it when I work on statistic, for instance, the contour of 2-dimentional gaussian distribution or something.

0. Ellipse without rotation

Before getting into rotation of ellipse. We should be on the same page about ordinal ellipse. Let us think about the ellipse which is denoted in the following equation. $$\left(\begin{array}{c} x_1 \\ x_2 \end{array} \right)^T \begin{pmatrix} 4 & 0 \\ 0 & 9\end{pmatrix}\left(\begin{array}{c} x_1 \\ x_2 \end{array} \right) = 1$$
This can be expressed as below. $$9x_1^2 + 4x_2^2 = 1$$
Therfore this is the ellipse whose semi-major axis is $\frac{1}{2}$, semi-major is $\frac{1}{3}$.

1. Rotation of ellipse

Then what I wanna work on in this article is the case that the non diagonal element is not ZERO. Following is one of the example. $$\left(\begin{array}{c} x_1 \\ x_2 \end{array} \right)^T \begin{pmatrix} 4 & 0.5 \\ 0.5 & 9\end{pmatrix}\left(\begin{array}{c} x_1 \\ x_2 \end{array} \right) = 1$$
Actually it's rotated ellipse. And it's a little bit complicated than ellipse without rotation. Let's say these equation can be denoted as following. $$\vec{x}^T A \vec{x} = 1\tag{1}$$
Then, if nondiagonal elements is ZERO, we can see it as ordinal ellipse. Therefore let's think about diagonalization.
Let us assume eigen vector of $A$ is $\vec{t_1}$, $\vec{t_2}$, $T$ is the matrix which consists of eigen vectors of $A$, $T = (\vec{t_1},\vec{t_2})$. Then matrix $A$ can be diagonalized by matrix $T$. (Since matrix $T$ is orthogonal matrix, $T = T^{T}$) $$T^{-1}AT = T^{T}AT = \begin{pmatrix}\lambda_1 & 0 \\ 0 & \lambda_2\end{pmatrix}$$

Note :
As you may know, necessary and sufficient conditoins for matrix to be diagnonalizable is having $n$ number of eigen vectors which is linearly independent. In this case, we assume matrix $A$ to be symmentric matrix, thus $A$ can be diagonalized by Orthogonal matrix.

Suppose $\begin{pmatrix}\lambda_1 & 0 \\ 0 & \lambda_2\end{pmatrix} =P$,
$$A = TPT^T$$ Substitute $P$ into (1),
$$\begin{eqnarray}x^TTPT^{-1}x &=& 1 \\ (T^Tx)^TP(T^Tx) &=&1\end{eqnarray}$$
From above equation, we can tell that rotated ellipse would be the one whose semi-major axis is $\frac{1}{\lambda_1}$, semi-major axisis $\frac{1}{\lambda_2}$ on new axes which defined by $T^Tx$. Or we can say linear transformed ellipse whose semi-major axis is $\frac{1}{\lambda_1}$, semi-major axisis $\frac{1}{\lambda_2}$ by $T^T$:)

No comments:

Post a Comment