I am trying to derive the equation of an ellipse given by the intersection of a cone, whose axis is inclined relative to the z-axis, and a plane at height $ z = H $. The equation describing a cone with an axis parallel to the unit vector $ \mathbf{d} $ should be \begin{equation} \left( \mathbf{u} \cdot \mathbf{d} \right)^2 - \| \mathbf{u} \|^2 \cos (\theta) = 0 \end{equation} where $ \mathbf{u} = \left[ x ; y ; z \right] $ and $ \theta $ is half the aperture of the cone. If $ \mathbf{d} = \left[ 0 ; \sin(\alpha) ; \cos(\alpha) \right] $, with $ \alpha < \pi / 2 $ angle with respect to the z-axis, the equation should become \begin{equation} \left( y \sin(\alpha) + z \cos(\alpha) \right)^2 - \left( x^2 + y^2 + z^2 \right) \cos (\theta) = 0 \end{equation} Considering $ z = H $, I should get \begin{equation} \left( y \sin(\alpha) + H \cos(\alpha) \right)^2 - \left( x^2 + y^2 + H^2 \right) \cos (\theta) = 0 \end{equation} but I don't see how this leads to the standard form of the ellipse equation. Where am I going wrong? Thanks.
-
1$\begingroup$ The standard form of the equation only holds for an ellipse whose axes are parallel to the coordinate axes, but that only happens if $\alpha=0$ or $\alpha=\pi/2$. $\endgroup$Intelligenti pauca– Intelligenti pauca2026-06-28 17:08:10 +00:00Commented 2 days ago
-
-
$\begingroup$ See also here: math.stackexchange.com/a/2177933/255730 $\endgroup$Intelligenti pauca– Intelligenti pauca2026-06-28 17:11:59 +00:00Commented 2 days ago
-
$\begingroup$ @Intelligentipauca The angle $\alpha$ tilts the axis of the cone somewhere into the $y,z$ plane. Intersecting the cone with the plane $z=H,$ by symmetry across the $y,z$ plane one axis of the section in that plane will be parallel to the $y$ axis. There's a flaw in the formulation but it doesn't prevent getting an axis-aligned ellipse. What we cannot get (unless $\alpha=0$ or the apex is cleverly offset) is an ellipse centered at the $z$ axis. $\endgroup$David K– David K2026-06-28 18:57:53 +00:00Commented 2 days ago
-
$\begingroup$ @DavidK You are right: I hadn't noticed that $\mathbf{d}$ was in the $y-z$ plane. $\endgroup$Intelligenti pauca– Intelligenti pauca2026-06-28 19:54:10 +00:00Commented 2 days ago
-
1$\begingroup$ Your equation has the form $ax^2+by^2+cy+d=0$. After centering, $ax^2+by^2=c$ which you easily turn into the classical expression. $\endgroup$Yves Daoust– Yves Daoust2026-06-28 21:10:16 +00:00Commented 2 days ago
2 Answers 2
Your equation for the cone is as follows
$ r^T ( \cos^2(\theta) I - {d d}^T ) r = 0 $
where $\theta$ and $d$ are as described in the OP, and $r = [x,y,z]^T $.
Assuming that $ d = [0, \sin (\alpha), \cos (\alpha) ] $, then intersection of the above equation with $z = H$, results in
$ (x^2 + y^2 + H^2) \cos^2(\theta) - (\sin(\alpha) y + H \cos( \alpha))^2 = 0 $
Expanding the second term and combining with the first term
$ x^2 \cos^2(\theta) + y^2 ( \cos^2(\theta) - \sin^2(\alpha) ) - 2 H \sin(\alpha) \cos(\alpha) y = H^2 (\cos^2(\alpha) - \cos^2(\theta) ) $
By looking at the coefficients, we can see that they are all expressible in terms of double the angles $\theta$ and $\alpha$. So the equation becomes
$ x^2 ( 1 + \cos(2 \theta) ) + y^2 ( \cos(2 \theta) + \cos(2 \alpha) ) - 2 H \sin(2 \alpha) y = H^2 ( \cos(2 \alpha) - \cos(2 \theta) ) $
Completing the square in $y$ gives
$ x^2 (1 + \cos(2 \theta) ) + (\cos(2 \theta) + \cos(2 \alpha) ) ( y - \dfrac{ H \sin(2 \alpha) }{ \cos(2 \theta) + \cos(2 \alpha) } )^2 - \dfrac{ H^2 \sin^2(2 \alpha) }{\cos(2 \theta) + \cos(2 \alpha) } = H^2 (( \cos(2 \alpha) - \cos(2 \theta) ) $
Define
$y_0 = \dfrac{ H \sin(2 \alpha)} { \cos(2 \theta) + \cos(2 \alpha) }$
$ a^2 = \dfrac{1}{\cos(2 \theta) + \cos(2 \alpha) }$
$ b^2 = \dfrac{1}{1 + \cos(2 \theta)} $
$ c^2 = H^2 (( \cos(2 \alpha) - \cos(2 \theta) ) + \dfrac{ H^2 \sin^2(2 \alpha) }{\cos(2 \theta) + \cos(2 \alpha) }$
Then your equation becomes
$ \dfrac{x^2}{b^2} + \dfrac{(y - y_0)^2}{a^2} = c^2 $
Note that $a \ge b$, with equality iff $ \alpha = 0 $.
Finally divide by $c^2$ and re-assign the values of $a$ and $b$ as follows
$ a \leftarrow a c $
$ b \leftarrow b c $
Then the equation final form is
$ \dfrac{x^2}{b^2} + \dfrac{(y - y_0)^2}{a^2} = 1 $
Note that $b^2$ is always positive, so that $b$ is real, however for $a^2$ we need to impose that
$ \cos(2 \theta) + \cos(2 \alpha) \gt 0 $
This condition can be written as
$ \cos(2 \theta) + 1 - (1 - \cos(2 \alpha) ) \gt 0 $
So that
$ \cos^2(\theta) \gt \sin^2(\alpha) $
We can safely assume that $\theta$ and $\alpha$ are angles in the first quadrant, so that their trigonometric ratios are positive, therefore, taking the square roots we get
$ \cos(\theta) \gt \sin(\alpha) = \cos(\dfrac{\pi}{2} - \alpha) $
Therefore, we must have
$ \theta \lt \dfrac{\pi}{2} - \alpha $
which can be expressed as follows:
$ \alpha + \theta \lt \dfrac{\pi}{2} $
For starters, there's an error in your formula for the cone. It should be $$ \left( \mathbf{u} \cdot \mathbf{d} \right)^2 - \lVert \mathbf{u} \rVert^2 \cos^2(\theta) = 0. $$ See my answer to another question for a derivation. But the effect of using $\cos(\theta)$ instead of $\cos^2(\theta)$ is just that you have a half-aperture angle that is something other than $\theta,$ so that doesn't prevent you from getting a formula for an ellipse.
For this answer I'll assume that $0 < \theta < \frac\pi2$ (following the usual way to measure the half-aperture of a non-degenerate cone) and that $-\frac\pi2 \leq \alpha < \frac\pi2.$ That is, the cone's axis is not parallel to the intersecting plane (because then you could only get a hyperbola, not an ellipse) and of the two candidates for $\mathbf d$ for the same double cone we choose the one with positive $z$-coordinate. I'll also assume that $\lvert\alpha\rvert + \theta < \frac\pi2$ because otherwise you get a parabola or hyperbola, not an ellipse.
Starting with the equation $$ \left( y \sin(\alpha) + H \cos(\alpha) \right)^2 - \left( x^2 + y^2 + H^2 \right) \cos^2(\theta) = 0, \tag1 $$ if we expand $(1)$ to get terms in powers of $x$ and $y$ and then collect terms in like powers we get \begin{multline} -x^2 \cos^2(\theta) + y^2 (\sin^2(\alpha) - \cos^2(\theta)) + 2 H y \sin(\alpha) \cos(\alpha) \\ + H^2 \cos^2(\alpha) - H^2 \cos^2(\theta) = 0.\tag2 \end{multline} Multiplying $(2)$ through by $-1$ gets rid of the leading negative sign: \begin{multline} x^2 \cos^2(\theta) + y^2 (\cos^2(\theta) - \sin^2(\alpha)) - 2 H y \sin(\alpha) \cos(\alpha)\\ - H^2 \cos^2(\alpha) + H^2 \cos^2(\theta) = 0.\tag3 \end{multline}
Note that since $0 \leq \lvert\alpha\rvert < \frac\pi2 - \theta < \frac\pi2,$ we have $\cos^2(\theta) - \sin^2(\alpha) > 0.$ So starting with $y^2(\cos^2(\theta) - \sin^2(\alpha)) - 2Hy \sin(\alpha)\cos(\alpha)$ we can complete the square as follows: \begin{multline} \left(y\sqrt{\cos^2(\theta) - \sin^2(\alpha)} - \frac{H\sin(\alpha)\cos(\alpha)}{\sqrt{\cos^2(\theta) - \sin^2(\alpha)}} \right)^2 \\ = y^2(\cos^2(\theta) - \sin^2(\alpha)) - 2Hy \sin(\alpha)\cos(\alpha) + \frac{H^2\sin^2(\alpha)\cos^2(\alpha)}{\cos^2(\theta) - \sin^2(\alpha)}. \tag4 \end{multline}
From $(3)$ and $(4)$ we get \begin{multline} x^2 \cos^2(\theta) + \left(y\sqrt{\cos^2(\theta) - \sin^2(\alpha)} - \frac{H\sin(\alpha)\cos(\alpha)}{\sqrt{\cos^2(\theta) - \sin^2(\alpha)}} \right)^2 \\ - \frac{H^2\sin^2(\alpha)\cos^2(\alpha)}{\cos^2(\theta) - \sin^2(\alpha)} - H^2 \cos^2(\alpha) + H^2 \cos^2(\theta) = 0.\tag5 \end{multline}
Now let's see what we can do with the constant term after we take out the factor $-H^2$: \begin{align} \frac{\sin^2(\alpha)\cos^2(\alpha)}{\cos^2(\theta) - \sin^2(\alpha)} &+ \cos^2(\alpha) - \cos^2(\theta) \\ &= \frac{\sin^2(\alpha)\cos^2(\alpha) + (\cos^2(\theta) - \sin^2(\alpha))(\cos^2(\alpha) - \cos^2(\theta)) } {\cos^2(\theta) - \sin^2(\alpha)}\\ &= \frac{\cos^2(\theta) \sin^2(\alpha) - \cos^4(\theta) + \cos^2(\alpha) \cos^2(\theta)} {\cos^2(\theta) - \sin^2(\alpha)}\\ &= \frac{\cos^2(\theta) - \cos^4(\theta)} {\cos^2(\theta) - \sin^2(\alpha)}. \tag6 \end{align}
So if we let \begin{align} m &= \cos(\theta), \\ n &= \sqrt{\cos^2(\theta) - \sin^2(\alpha)}, \\ k &= \frac{H\sin(\alpha)\cos(\alpha)}{\cos^2(\theta) - \sin^2(\alpha)}, \\ p &= H \sqrt{\frac{\cos^2(\theta) - \cos^4(\theta)} {\cos^2(\theta) - \sin^2(\alpha)}}, \end{align}
Then from $(5)$ and $(6)$ we get $$ m^2 x^2 + n^2 (y - k)^2 = p^2.\tag7 $$
Along with the condition $z = H,$ this is the equation of an axis-aligned ellipse in the plane $z = H$ with semimajor axis $\frac pn$ parallel to the $y$ axis, semiminor axis $\frac pm$ parallel to the $x$ axis, and center at $(0,k,H).$ The ellipse axis parallel to the $y$ axis is the major axis and the center is offset in the $y$ direction because the axis of the cone was tilted away from the $z$ axis toward the $y$ axis.
If you want the ellipse to have its center on the $z$ axis (that is, at $(0,0,H)$) when $\alpha\neq 0$ you need to move the apex of the cone by an offset of magnitude $k,$ which depends on $\alpha.$ With apex at $(0,-k,0)$ you can obtain the usual formula $$ \frac{x^2}{a^2} + \frac{y^2}{b^2} = 1. $$ If you want the major axis to be parallel to the $x$ axis you need to tilt the axis of the cone toward the $x$ axis rather than the $y$ axis and offset the apex along the $x$ axis.