Area and center location of an ellipse generated by the intersection of an ellipsoid and plane I am working on a model that requires that I know the area and center coordinates of the ellipse that is created by the intersection of an ellipsoid and a plane.
Specifically, for the location of the center of the ellipse I want to know the coordinates of this ellipse in Cartesian coordinates.
The general equations for the ellipsoid and plane I have started with are:
$$\frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1$$
$$m(x-x_0) + n(y-y_0) + k(z-z_0) = 0$$
I am writing the general forms of these equations because actually I need to be able to solve this for a number of different ellipses and planes with different orientations.
One specific case that I would like to use this solution for first is the case of an ellipsoid that is defined by:
$$a = 7, b  = 5, c = 6$$
and a plane defined by:
$$(y+b)tan(\theta)-z + \frac{1}{2} = 0$$
Where $\theta$ is the desired angle of the plane, in this case $\theta=30^o$ is perfectly fine (arbitrary example).
Please note that "b" is the same b used in the equation of the ellipsoid.
I looked at some of the other threads that have asked about plane ellipsoid intersections. However, since I specifically need to calculate the area of the ellipse generated by this intersection and the location of its center, when I tried to use a parametric solution, I had difficulty doing this once I had the parametric equations.
I would really love to learn how to solve this problem so I can include it into my model. Help is greatly appreciated.
Thank you!
-Christian

Without loss of generality, you can translate the ellipsoid to origin, rotate it so that its semiaxes are parallel to the Cartesian coordinate axes, and reorder the axes so that the $z$ component of the intersection plane normal in the rotated coordinates has the largest magnitude.  Then, the points on the ellipsoid fulfill
$$\frac{x^2}{r_x^2} + \frac{y^2}{r_y^2} + \frac{z^2}{r_z^2} = 1 \tag{1}\label{AC1}$$
where $r_x$, $r_y$, and $r_z$ are the ellipsoid semiaxes.
Define the plane using its normal $(n_x, n_y, n_z)$ and signed distance from origin $n_d$, i.e. point $(x, y, z)$ is on the plane if and only if
$$x n_x + y n_y + z n_z = n_d \tag{2a}\label{AC2a}$$
Solving this for $z$ yields
$$z = \frac{n_d - x n_x - y n_y}{n_z} \tag{2b}\label{AC2b}$$
(We reorder the axes so that $\lvert n_z \rvert \ge \lvert n_y \rvert$, $\lvert n_z \rvert \ge \lvert n_x \rvert$, to avoid division by zero, and in numerical computations, for best numerical stability.)
Substituting $\eqref{AC2b}$ into $\eqref{AC1}$ yields general quadratic form
$$a x^2 + b x y + c y^2 + d x + e y + f = 0$$
where (assuming $n_z r_z \ne 0$, both sides multiplied by $n_z^2 r_z^2$)
$$\left\lbrace ~ \begin{aligned}
a &= n_x^2 + n_z^2 r_z^2 / r_x^2 \\
b &= 2 n_x n_y \\
c &= n_y^2 + n_z^2 r_z^2 / r_y^2 \\
d &= -2 n_x n_d \\
e &= -2 n_y n_d \\
f &= n_d^2 - n_z^2 r_z^2 \\
\end{aligned} \right . \tag{3}\label{AC3}$$
Using this answer by Osmund Francis and the Wikipedia Ellipse article, we can express the following:
The discriminant $D$ (note sign convention!) is
$$D = b^2 - 4 a c$$
where the intersection is an ellipse if and only if $D \lt 0$.
Center of the ellipse is at $(x_0, y_0)$,
$$\left\lbrace ~ \begin{aligned}
\displaystyle x_0 &= \frac{2 c d - b e}{D} \\
\displaystyle y_0 &= \frac{2 a e - b d}{D} \\
\end{aligned} \right.$$
Semimajor axis length $r_+$ and semiminor axis length $r_-$ are
$$\begin{aligned}
r_+ &= \frac{1}{-D}\sqrt{ 2 ( a e^2 + c d^2 - b d e + f D ) ( a + c + \sqrt{ b^2 + ( a - c )^2 } ) } \\
r_- &= \frac{1}{-D}\sqrt{ 2 ( a e^2 + c d^2 - b d e + f D ) ( a + c - \sqrt{ b^2 + ( a - c )^2 } ) } \\
\end{aligned}$$
and the area $A$ of the ellipse is
$$A = \pi ~ r_+ ~ r_-$$
The angle $\theta$ between $x$ axis and major axis is
$$\theta = \begin{cases}
\operatorname{atan2}\left(c - a - \sqrt{b^2 + (a-c)^2}, b\right), & b \ne 0 \\
0, & b = 0, \quad a \lt c \\
90^o, & b = 0, \quad a \gt c \\
0, & b = 0, \quad a = c, \quad \lvert d \rvert \ge \lvert f \rvert \\
90^o, & b = 0, \quad a = c, \quad \lvert d \rvert \lt \lvert f \rvert \\
\end{cases}$$
Note that the major axis intersects the ellipse at $(x_{+1}, y_{+1})$ and $(x_{+2}, y_{+2})$,
$$\left\lbrace ~ \begin{aligned}
x_{+1} &= x_0 + r_+ ~ \cos\theta \\
y_{+1} &= y_0 + r_+ ~ \sin\theta \\
\end{aligned} \right ., \quad \left\lbrace ~ \begin{aligned}
x_{+2} &= x_0 - r_+ ~ \cos\theta \\
y_{+2} &= y_0 - r_+ ~ \sin\theta \\
\end{aligned} \right .$$
and similarly the minor axis intersects the ellipse at $(x_{-1}, y_{-1})$ and $(x_{-2}, y_{-2})$,
$$\left\lbrace ~ \begin{aligned}
x_{-1} &= x_0 + r_- ~ \cos\theta \\
y_{-1} &= y_0 + r_- ~ \sin\theta \\
\end{aligned} \right ., \quad \left\lbrace ~ \begin{aligned}
x_{-2} &= x_0 - r_- ~ \cos\theta \\
y_{-2} &= y_0 - r_- ~ \sin\theta \\
\end{aligned} \right .$$
Finally, using angle parameter $\varphi$, we can parametrize the ellipse as $\bigr(x(\varphi), y(\varphi)\bigr)$, $0 \le \varphi \le 360^o$,
$$\left\lbrace ~ \begin{aligned}
x(\varphi) &= x_0 + r_+ \cos\theta \cos\varphi - r_- \sin\theta \sin\varphi \\
y(\varphi) &= y_0 + r_+ \sin\theta \cos\varphi + r_- \cos\theta \sin\varphi \\
\end{aligned} \right .$$
which is just $x = r_+ \cos \varphi$, $y = r_- \sin\varphi$, rotated by $\theta$, and translated to $(x_0, y_0)$.
