TExcelTAD

Conic Sections

Slice a double cone with a flat plane and the edge of the cut is a circle, an ellipse, a parabola or a hyperbola. These four curves, the conic sections, are also the graphs of second-degree equations in xx and yy. This lesson gives each curve's standard equation, its key features (centre, foci, vertices, asymptotes) and where you meet them in orbits, satellite dishes, lenses and game code.

Four curves from one cone

Plane cut Curve Standard equation (centre or vertex at origin)
perpendicular to the axis circle x2+y2=r2x^2 + y^2 = r^2
tilted, cutting all the way round ellipse x2a2+y2b2=1\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1
parallel to the side of the cone parabola y=x24py = \frac{x^2}{4p}, or y2=4pxy^2 = 4px
steeper than the side, cutting both halves hyperbola x2a2−y2b2=1\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1

Every conic is the graph of an equation Ax2+Bxy+Cy2+Dx+Ey+F=0Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0. Without the xyxy term (B=0B = 0, no rotation) you can tell them apart from AA and CC: A=CA = C gives a circle, same sign gives an ellipse, one of them zero gives a parabola, opposite signs give a hyperbola.

The circle and the ellipse

A circle with centre (h,k)(h, k) and radius rr is the set of points at distance rr from the centre: (x−h)2+(y−k)2=r2(x - h)^2 + (y - k)^2 = r^2. Moving the centre just replaces xx by x−hx - h and yy by y−ky - k, as in transformations.

An ellipse is the set of points whose distances to two fixed points, the foci, add up to a constant 2a2a. In standard form x2a2+y2b2=1\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 with a>ba > b:

  • aa is the semi-major axis (vertices at (±a,0)(\pm a, 0)), bb the semi-minor axis;
  • the foci are at (±c,0)(\pm c, 0) with c2=a2−b2c^2 = a^2 - b^2;
  • the eccentricity e=c/ae = c/a measures how stretched it is (0 for a circle, near 1 for a long thin ellipse).

The "two pins and a string" definition is easy to test numerically:

python · try it yourself
import math

a, b = 5, 3
c = math.sqrt(a**2 - b**2)                 # foci at (±4, 0)
print("c =", c, " eccentricity =", c / a)

for t in [0, 0.7, 1.5, 2.5, 4.0]:
    x, y = a * math.cos(t), b * math.sin(t)  # a point on the ellipse
    d1 = math.dist((x, y), (-c, 0))
    d2 = math.dist((x, y), (c, 0))
    print(f"point ({x:6.3f}, {y:6.3f}): d1 + d2 = {d1 + d2:.6f}")
c = 4.0  eccentricity = 0.8
point ( 5.000,  0.000): d1 + d2 = 10.000000
point ( 3.824,  1.933): d1 + d2 = 10.000000
point ( 0.354,  2.992): d1 + d2 = 10.000000
point (-4.006,  1.795): d1 + d2 = 10.000000
point (-3.268, -2.270): d1 + d2 = 10.000000

The sum is always 2a=102a = 10. Planets move on ellipses with the Sun at one focus (Kepler's first law); Earth's orbit has e≈0.017e \approx 0.017, very nearly a circle.

The parabola

A parabola is the set of points at equal distance from a fixed point (the focus) and a fixed line (the directrix). With the vertex at the origin, focus (0,p)(0, p) and directrix y=−py = -p, the equation is x2=4pyx^2 = 4py.

Its reflective property is used everywhere: rays coming in parallel to the axis bounce off the parabola and all pass through the focus. That is why satellite dishes, solar cookers and car headlights are parabolic. In physics, anything thrown under constant gravity (without air resistance) follows a parabola, so projectile paths in games are parabolas too.

The hyperbola

A hyperbola is the set of points where the difference of the distances to two foci is a constant 2a2a. In standard form x2a2−y2b2=1\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1:

  • vertices at (±a,0)(\pm a, 0), foci at (±c,0)(\pm c, 0) with c2=a2+b2c^2 = a^2 + b^2 (plus, not minus);
  • two branches that approach the asymptotes y=±baxy = \pm\frac{b}{a}x;
  • eccentricity e=c/a>1e = c/a > 1.

Old radio navigation (LORAN) used hyperbolas: the difference in arrival times of signals from two stations puts the receiver on a hyperbola with the stations as foci.

python · try it yourself
import numpy as np
import matplotlib.pyplot as plt

t = np.linspace(0, 2 * np.pi, 300)
s = np.linspace(-1.6, 1.6, 200)
plt.figure(figsize=(6, 6))
plt.plot(2 * np.cos(t), 2 * np.sin(t), label="circle  x² + y² = 4")
plt.plot(5 * np.cos(t), 3 * np.sin(t), label="ellipse  x²/25 + y²/9 = 1")
xp = np.linspace(-4, 4, 200)
plt.plot(xp, xp**2 / 4, label="parabola  x² = 4y")
for sign in (1, -1):
    plt.plot(sign * 2 * np.cosh(s), 1.5 * np.sinh(s), "C3", label="hyperbola  x²/4 − y²/2.25 = 1" if sign == 1 else None)
plt.plot(xp * 2, 0.75 * xp * 2, "C3:", lw=1)
plt.plot(xp * 2, -0.75 * xp * 2, "C3:", lw=1)
plt.xlim(-7, 7); plt.ylim(-6, 6); plt.gca().set_aspect("equal")
plt.legend(fontsize=8, loc="lower right")
print("drawn: circle, ellipse, parabola, hyperbola with asymptotes")
drawn: circle, ellipse, parabola, hyperbola with asymptotes

In software

  • Collision shapes. Circle tests (is the distance between centres less than the sum of the radii?) are the cheapest collision checks in games (Circles and Spheres). An ellipse test is a circle test after scaling xx by 1/a1/a and yy by 1/b1/b.
  • Ballistics. An aiming system solves the parabola of a projectile for the launch angle that hits a target.
  • Ray tracing. A ray hitting a sphere, cylinder or paraboloid leads to a quadratic equation, the same algebra as conics (Ray–Sphere).

For conics in calculus and in polar form, see Conic Sections and Conics in Polar Coordinates.

Exercises

Exercise 1: Identify

Name the conic: (a) 4x2+4y2=364x^2 + 4y^2 = 36, (b) x2−9y2=9x^2 - 9y^2 = 9, (c) y=2x2−3y = 2x^2 - 3, (d) 9x2+16y2=1449x^2 + 16y^2 = 144.

Answer

(a) circle, (b) hyperbola, (c) parabola, (d) ellipse.

Solution
(a) A=C=4→circle x2+y2=9, r=3(b) A=1, C=−9, opposite→hyperbola x29−y2=1(c) no y2 term→parabola(d) A=9, C=16, same sign→ellipse x216+y29=1\begin{aligned} &\text{(a) } A = C = 4 && \to \text{circle } x^2 + y^2 = 9,\ r = 3 \\ &\text{(b) } A = 1,\ C = -9,\ \text{opposite} && \to \text{hyperbola } \tfrac{x^2}{9} - y^2 = 1 \\ &\text{(c) no } y^2 \text{ term} && \to \text{parabola} \\ &\text{(d) } A = 9,\ C = 16,\ \text{same sign} && \to \text{ellipse } \tfrac{x^2}{16} + \tfrac{y^2}{9} = 1 \end{aligned}

Exercise 2: Complete the square

Find the centre and radius of x2+y2−6x+4y−12=0x^2 + y^2 - 6x + 4y - 12 = 0.

Answer

Centre (3,−2)(3, -2), radius 5.

Solution
(x2−6x+9)+(y2+4y+4)=12+9+4(x−3)2+(y+2)2=25\begin{aligned} (x^2 - 6x + 9) + (y^2 + 4y + 4) &= 12 + 9 + 4 \\ (x - 3)^2 + (y + 2)^2 &= 25 \end{aligned}

Exercise 3: Ellipse facts

For x2169+y225=1\frac{x^2}{169} + \frac{y^2}{25} = 1, find the foci and the eccentricity.

Answer

Foci (±12,0)(\pm 12, 0), e=12/13≈0.923e = 12/13 \approx 0.923.

Solution
a=13,b=5,c2=169−25=144,c=12e=c/a=12/13\begin{aligned} &a = 13,\quad b = 5,\quad c^2 = 169 - 25 = 144,\quad c = 12 \\ &e = c/a = 12/13 \end{aligned}

Exercise 4: Point in an ellipse

Write a function inside(x, y, a, b) that returns True when (x,y)(x, y) lies inside or on the ellipse x2a2+y2b2=1\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1. Test it on (3,2)(3, 2), (4,2)(4, 2) and (0,3)(0, 3) with a=5a = 5, b=3b = 3.

Answer

True, False, True.

Solution
(3,2):925+49≈0.804≤1→inside(4,2):1625+49≈1.084>1→outside(0,3):0+99=1→on the ellipse\begin{aligned} (3, 2)&: \tfrac{9}{25} + \tfrac{4}{9} \approx 0.804 \le 1 && \to \text{inside} \\ (4, 2)&: \tfrac{16}{25} + \tfrac{4}{9} \approx 1.084 > 1 && \to \text{outside} \\ (0, 3)&: 0 + \tfrac{9}{9} = 1 && \to \text{on the ellipse} \end{aligned}
python · try it yourself
def inside(x, y, a, b):
    return (x / a)**2 + (y / b)**2 <= 1

print(inside(3, 2, 5, 3), inside(4, 2, 5, 3), inside(0, 3, 5, 3))
True False True

Test yourself

For the ellipse x225+y216=1\frac{x^2}{25} + \frac{y^2}{16} = 1, where are the foci?

  1. (±3,0)(\pm 3, 0)
  2. (±5,0)(\pm 5, 0)
  3. (±4,0)(\pm 4, 0)
  4. (0,±3)(0, \pm 3)

What are the asymptotes of x29−y24=1\frac{x^2}{9} - \frac{y^2}{4} = 1?

  1. y=±32xy = \pm\frac{3}{2}x
  2. y=±23xy = \pm\frac{2}{3}x
  3. y=±49xy = \pm\frac{4}{9}x
  4. There are none

Why are satellite dishes parabolic?

  1. Parabolas are the cheapest shape to build
  2. Incoming rays parallel to the axis all reflect through the focus
  3. A parabola has two foci
  4. It makes the dish lighter