Equations

The equation for an ellipsoid with axises \(e_1, e_2\) and \(e_3\): \[E(x) := \frac{x_1^2}{e_1^2} + \frac{x_2^2}{e_2^2} + \frac{x_3^2}{e_3^2} - 1 = 0\] Let \(y = \begin{bmatrix} y_1 & y_2 & y_3 \end{bmatrix}^T\) be a point outside the ellipsoid. For any point \(x = \begin{bmatrix} x_1 & x_2 & x_3 \end{bmatrix}^{T}\) on the ellipsoid we have1: \[y - x = \frac{1}{2} t \nabla E(x),\] or equivalently in component form, \[y_k = \left( 1 + \frac{t}{e_k^2} \right) x_k, \qquad k=1,2,3.\] The values \(x_k\) can be expressed as a function of \(t\): \[x_k(t):=\frac{e_k^2}{t+e_k^2} y_k, \qquad k=1,2,3,\] and their derivatives are given by, \[x_k'(t) = -\frac{e_k^2}{(t+e_k^2)^2} y_k = -\frac{x_k(t)}{t+e_k^2}, \qquad k=1,2,3.\] The equation of the ellipsoid is reduced to a scalar equation in \(t\): \[E(t)=\frac{x_1^2(t)}{e_1^2} + \frac{x_2^2(t)}{e_2^2} + \frac{x_3^2(t)}{e_3^2} - 1.\] The derivative \(E'(t)\) is simply: \[E'(t)=\frac{2 x_1(t) x_1'(t)}{e_1^2} + \frac{2 x_2(t) x_2'(t)}{e_2^2} + \frac{2 x_3(t) x_3'(t)}{e_3^2}.\]


  1. http://www.geometrictools.com/Documentation/DistancePointEllipseEllipsoid.pdf