4

Suppose we have the quadratic form of an ellipsoid of the form

$$ax^2 + by^2+cz^2+dxy+eyz+fxz+gx+hy+iz+j=0$$

I want to find centroid of the arbitrarily oriented ellipsoid, its semi-axes, and the angles of rotation.

For the 2D case I found an answer here. I was wondering if someone can help me do the same for 3D.

  • Welcome to Math.SE! How much linear algebra have you seen? Particularly, do you know how to find the eigenvalues and eigenvectors of a $3 \times 3$ real symmetric matrix? – Andrew D. Hwang Jul 04 '16 at 15:45
  • 1
    Yes, I know that eigenvalues and eigenvectors define the length and direction of semi axes. However I do not get the right results. – Vahagn Tumanyan Jul 04 '16 at 16:00
  • You should probably include an example that did not work out well. If you have not tried any examples and are just hoping to do everything with variables, well... – Will Jagy Jul 04 '16 at 20:15

1 Answers1

3

The equation of an ellipsoid centered at the origin has the form $q_A(\mathbf{v}) = \mathbf{v}^T A \mathbf{v} = C$ where $C > 0$ and $A$ is a symmetric matrix whose eigenvalues are all positive. If the eigenvalues of $A$ are $\lambda_i$ with a corresponding orthonormal basis of eigenvectors $v_i$ (so $Av_i = \lambda_i v_i$) then the semi-principal axes of the ellipsoid are the $v_i$'s with lengths $\lambda_i$.

If the ellipsoid is centered at $\mathbf{p}$ instead of the origin, the equation describing it is

$$ q_A(\mathbf{v} - \mathbf{p}) = (\mathbf{v} - \mathbf{p})^T A (\mathbf{v} - \mathbf{p}) = \mathbf{v}^T A \mathbf{v} - 2 \mathbf{v}^T A \mathbf{p} + \mathbf{p}^T A \mathbf{p} = C.$$

Thus, the first part of the equation is quadratic in $\mathbf{v}$, the second part of the equation is linear in $\mathbf{v}$ and the third part is constant. To rewrite your equation in the form above, we set

$$ \mathbf{v} = \begin{pmatrix} x \\ y \\ z \end{pmatrix}, A = \begin{pmatrix} a & \frac{d}{2} & \frac{f}{2} \\ \frac{d}{2} & b & \frac{e}{2} \\ \frac{f}{2} & \frac{e}{2} & c\end{pmatrix}, \mathbf{p} = A^{-1} \begin{pmatrix} \frac{-g}{2} \\ \frac{-h}{2} \\ \frac{-i}{2} \end{pmatrix}, C = \mathbf{p}^T A \mathbf{p} - j.$$

If the eigenvalues of $A$ are all positive and $C > 0$, then your equation indeed describes an ellipsoid whose center is $\mathbf{p}$ and whose semi-principal axes are given by an orthonormal basis of eigenvectors of $A$ with lengths the corresponding eigenvalues.

levap
  • 65,634
  • 5
  • 79
  • 122
  • Is the ellipse in your example assumed to be non-oriented? Because I have calculated the center point $p$ the same way, but my actual question is how it can be determined in the oriented case. – Vahagn Tumanyan Jul 05 '16 at 13:34
  • @VahagnTumanyan What do you mean by "oriented"? – levap Jul 05 '16 at 15:20
  • by oriented I mean that ellipsoid can be in general rotated about x,y or z axes. The direction of axes of ellipsoid is not the same direction of coordinate system axes. – Vahagn Tumanyan Jul 05 '16 at 15:36
  • Yes, this equation takes it into account. – levap Jul 05 '16 at 15:50