# Equation for conic section given an arbitrary cone?

I learned in school that the curve formed by the intersection of a double cone and a plane is always one of the three types of curves called "conic sections" - an ellipse, a parabola, or a hyperbola (or the degenerate forms of each - a point, a line, or a pair of lines). Apparently this has been known since at least the days of the ancient Greek mathematicians. And Cartesian coordinate systems have also been around for centuries. Both are very useful and easy to study.

But it is surprisingly difficult for me to find any references describing how to relate the conic sections to defined cones and planes that are defined in a 3D Cartesian coordinate system. Surely someone has done it before!

In general, what is the equation for the intersection of the Cartesian XY plane with a circular double cone centered at $$(x_c, y_c, z_c)$$, with axis of symmetry $$[x_a, y_a, z_a]$$ and with an angle of $$\theta$$?

As a simple example, if the cone is centered at $$(5, 6, 10)$$ and has an axis $$[0, 0, 1]$$ and an angle of 45°, then its intersection with the XY plane is the circle $$(x - 5)^2 + (y - 6)^2 = 100$$. But surely there must be a general solution?

• Usually it's easier to just rotate the cone such that its axis coincides with $z$ and apply the same rotation to the plane. Commented Feb 29 at 18:45
• Even if I rotated the cone and plane, though - I can see how that might make it easier to intuitively understand whether I have a hyperbola or ellipse or whatever, but how could I find the actual equation of the intersection? Commented Feb 29 at 19:08

Here's a relatively elementary approach. The main difficulty is simply in coming up with an equation for an arbitrary cone.

Consider a right circular cone. Let the position vector of the vertex of the cone be $$\mathbf c = [x_c, y_c, z_c]^T$$. Let the axis of the cone be parallel to the vector $$\mathbf a = [x_a, y_a, z_a]^T$$ and the half-angle of the opening be $$\theta$$ (so $$\theta$$ is the angle between the axis and one of the lines lying on the surface of the cone.

Then if $$\mathbf x = [x,y,z]^T$$ is an arbitrary point on the surface of the cone other than the vertex the vector $$\mathbf x - \mathbf c$$ is a vector parallel to one of the lines lying on the surface of the cone. Therefore the angle between $$\mathbf x - \mathbf c$$ and the vector $$\mathbf a$$ is either $$\theta$$ or $$\pi - \theta$$. That is,

$$(\mathbf x - \mathbf c)\cdot \mathbf a = \pm \lVert \mathbf x - \mathbf c\rVert \lVert \mathbf a\rVert \cos\theta.$$

For simplicity let's assume that $$\lVert \mathbf a\rVert = 1$$, since we can always "normalize" the axis vector to make this so. Squaring both sides of the equation above, we have

$$((\mathbf x - \mathbf c)\cdot \mathbf a)^2 = \lVert \mathbf x - \mathbf c\rVert^2 \cos^2\theta.$$

Spelling this out componentwise, $$((x - x_c)x_a + (y - y_c)y_a + (z - z_c)z_a)^2 = k^2 ((x - x_c)^2 + (y - y_c)^2 + (z - z_c)^2)$$ where $$k = \cos\theta$$. (I introduce $$k$$ here merely to emphasize that $$\cos\theta$$ is simply a constant in this formula.)

That's an equation of the cone. We can do the algebra to turn it into a polynomial in $$x$$, $$y$$, and $$z$$ in the usual form, but that will just give us another equation of the same cone.

To find the intersection with the XY plane, simply set $$z = 0.$$ Then

$$((x - x_c)x_a + (y - y_c)y_a - z_c z_a)^2 = k^2 ((x - x_c)^2 + (y - y_c)^2 + z_c^2).$$

As before, if you want the equation to be in a standard form like $$Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0$$, multiply out all the factors and collect all terms on the left side.

Let us do it the other way: use the fixed cone $$x^2+y^2=c^2z^2$$ and a variable plane $$z=ax+b$$ (we don't need a $$y$$ term, by symmetry). Now the equation reads $$x^2+y^2=c^2(ax+b)^2$$, or $$(1-c^2a^2)x^2+y^2-2abc^2x+b^2c^2=0$$, with three independent parameters.

Now this equation has all it takes to describe a reduced conic of genre decided by the sign of $$1-c^2a^2$$, or a general conic by translating/rotating the coordinates. The same trick would not work with an ellipsoid, as the coefficient $$1+c^2a^2$$ could not be non-positive.

This is actually very easy and straight forward, but only if you've studied a first course in linear algebra, which is usually offered at all universities in the first year.

Define the vector $$r = [x, y, z]^T$$ where $$T$$ denotes transposition. Then the equation of the cone whose vertex is at $$C$$ is

$$(r - C)^T Q (r - C) = 0$$

where $$Q$$ is a symmetric $$3 \times 3$$ matrix, that either has two positive eigenvalues and one negative eigenvalue, or two negative eigenvalues and one positive eigenvalue. The cone doesn't have to be a right circular cone, but if it is then $$Q$$ is given by

$$Q = (\cos^2 \theta) I_3 - a a^T$$

where $$\theta$$ is the angle between the axis of the cone and it generatrix, and is called the semi-vertical angle. $$a$$ is a unit vector along the axis of the cone. $$I_3$$ is the $$3 \times 3$$ identity matrix.

The cutting plane is usually given in algebraic form as $$n^T r = d$$

The first step to the solution is to find the vectorial representation of the plane. This can be done by finding two vectors $$v_1$$ and $$v_2$$ that satisfy

$$v_1 \cdot n = v_2 \cdot n = v_1 \cdot v_2 = 0$$ and $$v_1 \cdot v_1 = 1$$ and $$v_2 \cdot v_2 = 1$$

It follows that the vector $$r$$ for points on the plane can be expressed as

$$r = r_0 + V u$$

where $$V = [v_1, v_2]$$ is a $$3 \times 2$$ matrix and $$u = [u_1, u_2]^T$$ is a $$2 \times 1$$ vector.

Since you're interested in the intersection of the cone with $$XY$$ plane then $$n = [0, 0, 1]^T$$ , and $$d = 0$$. Therefore we can take

$$v_1 = [1, 0, 0]^T$$ and $$v_2 = [0, 1, 0]$$ and $$r_0 = [0,0,0]^T$$

So that

$$V = \begin{bmatrix} 1 && 0 \\ 0 && 1 \\ 0 && 0 \end{bmatrix}$$

And now the points on the $$XY$$ plane are given simply by

$$r = V u$$

The second step in the solution is to plug in this $$r$$ into the equation of the cone. This gives us

$$( V u - C)^T Q ( V u - C) = 0$$

Expand this quadratic form to obtain

$$u^T (V^T Q V) u - 2 u^T V^T Q C + C^T Q C = 0$$

Now, the $$2 \times 2$$ matrix $$V^T Q V$$ is symmetric, so it can be diagonalized and factored as follows

$$V^T Q V = R D R^T$$

where $$D$$ is diagonal, and $$R$$ is orthogonal (i.e. a rotation matrix).

Assuming $$D$$ has only non-zero diagonal elements, then the equation above represents either an ellipse or a hyperbola. In both cases the inverse of $$V^T Q V$$ exists, and we can find the center $$u_0$$ of this conic by the formula

$$u_0 = - \dfrac{1}{2} (V^T Q V)^{-1} \bigg( 2 V^T Q (r_0 - C) \bigg) = (V^T Q V)^{-1} V^T Q C$$

Now we can write the above quadratic equation as follows

$$(u - u_0)^T (V^T Q V) (u - u_0) = - C^T Q C + u_0^T (V^T Q V) u_0$$

Let the constant $$K = - C^T Q C + u_0^T (V^T Q V) u_0$$

Then

$$(u - u_0)^T R D_0 R^T (u - u_0) = 1$$

where $$D_0 = \dfrac{D}{K}$$

If $$D_0$$ has only positive entries on its diagonal, then we have an ellipse, if there is one positive and one negative entries on the diagonal of $$D_0$$ then we have a hyperbola. The case of having a parabolic section is substantially more difficult and should be handled separately.

The last equation above is the algebraic equation of the conic section in the coordinate vector $$u$$, relative to the axes $$v_1$$ and $$v_2$$.

• What does $Q$ represent in this solution? Commented Feb 29 at 19:41
• $Q$ is a $3 \times 3$ symmetric matrix. It sums within it the effect of the original upright cone dimensions, plus any rotation applied to the original upright cone (the one having its axis along the $z$ axis). Commented Feb 29 at 19:58
• Thanks for the answer... it is very dense though! Unfortunately my university linear algebra course was over 15 years ago and was taught by someone who was incapable of connecting the concepts to anything concrete, so very little actually stuck with me apart from the vocabulary. So far, I've figured out that $n$ is the normal vector to the plane and $u_1, u_2$ are basis vectors within the plane. I assume that somehow $Q$ defines the axis and angle of the double cone? I'm still working through the second step in your solution and what $V$ intuitively represents haha Commented Feb 29 at 20:09
• @ofcourse My point was that this answer simply starts using the symbol $Q$ without saying what it is. The answer should be edited to include this information, along with any relevant restrictions on $Q$. Surely not just any $3\times 3$ symmetric matrix produces a cone -- consider the case of $Q = I_3$. Commented Mar 1 at 20:16
• @mweiss Thanks for that. I've edited my answer to clarify the conditions on $Q$. Commented Mar 1 at 20:54