Skip to content

Cholesky decomposition of an ellipse-defining symmetric matrix

An ellipse can be defined via a symmetric, invertible and positive-definite (2×2)-matrix Aq. Such a matrix provides a quadratic form which in turn correlates the components of position vectors to points on an ellipse. This post shows that a Cholesky decomposition of the inverse of Aq provides a method to create an ellipse from a simple set of vectors which can be parameterized. We first determine the elements of the inverse of Aq. This will give us a respective lower triangular Cholesky matrix Kch which has to be applied to vectors defining a unit circle.

We work in a Cartesian coordinate system [CCS]. When I speak of “vectors”, I mean position-vectors from the origin of our chosen CCS to points somewhere in our 2-dimensional space. The components of such vectors have values that are equal to the (x,y)-coordinates of the points in our CCS. Required knowledge is some some Linear Algebra.

Related posts:

Introduction

A 2-dimensional ellipse can be defined by a quadratic form. By using a symmetric and invertible (nxn)-matrix An a quadratic form (of the components of a vector v ∈ ℝn is given by a function

\[ q: \,\, {\mathbb{R}}^n \, \rightarrow \, \mathbb{R}\,: \quad q(\pmb{v}) \:=\: \pmb{v}^{\operatorname{T}} \circ \operatorname{\pmb{A}}_n \circ \, \pmb{v} \,. \tag{1} \]

The open circle symbolizes the standard matrix multiplication. Writing q(v) in terms of the vector components we find that we get a polynomial. The maximum exponent occurring in terms of vector-components is 2. In a CCS such a polynomial controls the relation between the n coordinates of points on an ellipsoid. The coordinates are equivalent to the component values of vectors reaching from the origin of the CCS to points on the ellipsoid.

A special case is a quadratic form of vectors in a 2-dimensional space. Aq (= A2) then is a (2×2) matrix. Requiring the respective quadratic form to be equal to 1 defines an ellipse

\[ \mbox{Ellipse, }\,\, {\mathbb{R}}^2 \,: \quad \pmb{v}^{\operatorname{T}} \circ \operatorname{\pmb{A}}_q \circ \, \pmb{v} \:=\: 1 \tag{2} \]

as a special type of a conic section. I.e., condition (2) is fulfilled by vectors vE

\[ v_E \:=\: \begin{pmatrix} x_E \\ y_E \end{pmatrix} \tag{3} \]

reaching from the origin to points on an ellipse.

\[ \mbox{Ellipse, }\,\, {\mathbb{R}}^2 \,: \quad \pmb{v}_E^{\operatorname{T}} \circ \operatorname{\pmb{A}}_q \circ \, \pmb{v}_E \:=\: 1 \,. \tag{4} \]

We name the elements of our (2×2)-matrix α, β/2, γ :

\[ \operatorname{\pmb{A}} \:=\: \begin{pmatrix} \alpha & \beta/2 \\ \beta/2 & \gamma\end{pmatrix} \,. \tag{5} \]

The polynomial equation then becomes

\[ \alpha * x_E^2 \, + \beta * x_E \, y_E \, + \gamma * y_e^2 :=\: 1 \,. \tag{6} \]

We request the determinant of Aq to be bigger than 0 to guarantee the invertibility and positive definiteness of the matrix

\[ \begin{align} {\text{det}} \left( \operatorname{\pmb{A}}_q \right) \:=\: \alpha*\gamma \,-\, {1 \over 4}\, \beta^2 \:\gt\: 0 \,. \tag{7} \end{align} \]

I.e.,

\[ \beta^2 \:\lt\: 4\, \alpha \, \gamma \,. \tag{8} \]

In addition we have shown in the named previous post that for a positive-definite matrix A (and for an ellipse with both half-axes having positive values) the additional conditions

\[ \begin{align} \quad \alpha*\gamma \,\gt\, 0 \quad &\land \quad \alpha \,+\, \gamma \gt 0 \\[10pt] \Rightarrow \quad \alpha \,\gt\, 0 \quad &\land \quad \gamma \,\gt\, 0 \,. \end{align} \tag{9 }\]

must be fulfilled at the same time. Note: Regarding the positive-definiteness of Aq, a respective condition on the eigenvalues of A leads to the same result. I have shown this already in a previous post (eqs. (47) and (103) there). The geometrical requirement that the half-axes of the related ellipse must have a length > 0 is automatically fulfilled under these conditions.

The inverse of matrix A

Before we turn to a Cholesky decomposition let me give you the elements of the inverse [Aq]-1 of matrix Aq. [Aq]-1 has the elements:

\[ \left[ \operatorname{\pmb{A}}_q \right]^{-1} \:=\: {4\, \gamma \over 4\, \gamma \,\alpha \,-\, \beta^2} \, \begin{pmatrix} 1 & -\,\beta / (2\,\gamma) \\ -\,\beta / (2\,\gamma) & \alpha / \gamma \end{pmatrix} \tag{10} \,. \]

You can simply checking this by showing that we indeed get

\[ \left[ \operatorname{\pmb{A}}_q \right]^{-1} \,\circ\, \left[ \operatorname{\pmb{A}}_q \right] \:=\: \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \:=\: \operatorname{\pmb{I}}_2\,. \]

The inverse of Aq is again a symmetric, invertible and positive definite matrix.

Cholesky decomposition – and the connection to vectors defining a unit circle

Let us apply a Cholesky decomposition to the inverse of Aq. Such a decomposition for a positive-definite and symmetric matrix is always possible and it actually is unique in the sense that the involved triangular matrices are well and uniquely defined:

\[ \left[ \operatorname{\pmb{A}}_q \right]^{-1} \:=\: \operatorname{\pmb{K}}_{ch}\,\bullet\,\operatorname{\pmb{K}}_{ch}^{\operatorname{T}}\, . \tag{11} \]

Kch is a lower triangular matrix. T symbolizes the transposition operation. It is easy to show that Kch transforms vectors on a unit circle in a well defined way into position vectors of points on our target ellipse. If you insert

\[ \operatorname{\pmb{A}}_q \:=\: \left[ \operatorname{\pmb{K}}_{ch}\,\bullet\,\operatorname{\pmb{K}}_{ch}^{\operatorname{T}}\right]^{-1} \tag{12} \]

into eq. (2) and rearrange terms according to standard matrix rules you just get the definition equation for vectors to points on a unit circle:

\[ \left[ \operatorname{\pmb{K}}_{ch}^{-1} \circ \pmb{v}_E \right]^{\operatorname{T}} \circ \left[ \operatorname{\pmb{K}}_{ch}^{-1} \circ \pmb{v}_E \right] \:=\: 1 \,. \tag{13} \]

Therefore, a specific vector vE to a point on our ellipse is the result of a linear transformation of another specific vector vc,ch reaching to a point on a unit circle:

\[\pmb{v}_E = \operatorname{\pmb{K}}_{ch} \circ \pmb{v}_{c, ch} \,. \tag{14} \]

Kch, of course, operates in a unique way on vectors vc,ch. Our ellipse defined via A can therefore be constructed in a distinct way by applying Kch to all vectors defining the unit circle. Note that we can parameterize vc,ch as

\[ \pmb{v}_{c,ch} \,=\, \begin{pmatrix} \cos \theta \\ \sin\theta \end{pmatrix} \,, \quad 0\,\le\, \theta \,\le\, 2 \pi \,. \tag{15} \]

Elements of the lower triangular matrix Kch

Kch gives us a valuable tool to recreate ellipses defined by a symmetric matrix Aq from vectors on a unit circle. We can use it to check other methods to re-construct such an ellipse via linear transformations. The fact that there are alternative ways to create our ellipse with a different matrices has the following reason: As we start with a rotation-invariant unit circle, we can always add some initial rotation as a first step to a linear transformation of this rotational symmetric object. I will show examples in a forthcoming post in this blog.

The elements of Kch can be derived with a somewhat lengthy calculation from the elements of [Aq]-1. I omit details here. I just give you the result:

\[ \operatorname{\pmb{K}}_{ch} \:=\: \begin{pmatrix} k_1 &0 \\ k_3 & k_4 \end{pmatrix} \,, \tag{16} \]

with

\[\begin{align} k_1 \:&=\: \sqrt{\, {4 \, \gamma \over 4\, \gamma\, \alpha \,-\, \beta^2}\, } \,, \\[10pt] k_2 \:&=\: 0 \,, \\[10pt] k_3 \:&= \: -\, {\beta \over 2 \, \gamma} \, \sqrt{\, {4 \, \gamma \over 4\, \gamma\, \alpha \,-\, \beta^2}\, } \,, \\[17pt] k_4 \:&=\: \sqrt{ \,{1 \over \gamma}\, } \,. \end{align} \tag{17} \]

I.e.:

\[ \operatorname{\pmb{K}}_{ch} \:=\: \begin{pmatrix} \sqrt{ {4\, \gamma^{\phantom{A}} \over 4\,\gamma\,\alpha \,-\, \beta^2 } } & 0 \\ -\, {\beta \over 2 \gamma} \, \sqrt{ {4\, \gamma^{\phantom{A}} \over 4\,\gamma\,\alpha \,-\, \beta^2 } } & \sqrt{1\over \gamma} \, \end{pmatrix} \,. \tag{18} \]

Note that the square roots pose no problem due to the required fulfillment of relations (9).

We will use matrix Kch in a forthcoming post where I present numerical and graphical examples for the re-construction of an ellipse from matrix-elements:

\[ \mbox{Ellipse, }\,\, {\mathbb{R}}^2 \,: \quad \pmb{v}_E \:=\: \operatorname{\pmb{K}}_{ch} \circ \begin{pmatrix} \cos \theta \\ \sin \theta \end{pmatrix}\,, \quad 0\,\le\, \theta \,\le\, 2 \pi \,. \tag{19} \]

Conclusion

In this post we got familiar with an explicit method to construct an ellipse which is defined by a quadratic form. The quadratic form in turn was mediated by a symmetric, positive-definite matrix A. The construction method is based on the lower triangular matrix of a Cholesky decomposition of the inverse of A. It provides a distinct way to create the ellipse by a well defined linear transformation of vectors defining a unit circle.