TExcelTAD
Home › Calculus Essentials › Conic Sections

Conic Sections

The conic sections are the curves you get by slicing a double cone with a plane: the circle, the ellipse, the parabola and the hyperbola. Each one is also the graph of an equation of degree two in xx and yy. They describe planetary orbits, thrown balls, satellite dishes and collision shapes in games.

Four curves from one cone

Plane cuts the cone… Curve
straight across, perpendicular to the axis circle
at a tilt, through one half only ellipse
parallel to a side of the cone parabola
steeply, through both halves hyperbola (two branches)

Every conic is a solution set of a second-degree equation

Ax2+Bxy+Cy2+Dx+Ey+F=0Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0

and, when B=0B = 0, its type can be read from AA and CC: same sign gives an ellipse (a circle if A=CA = C), one of them zero gives a parabola, opposite signs give a hyperbola.

Standard forms

Centred at the origin (or with the vertex at the origin for a parabola):

Conic Equation Key facts
Circle x2+y2=r2x^2 + y^2 = r^2 radius rr
Ellipse x2/a2+y2/b2=1x^2/a^2 + y^2/b^2 = 1 (a≥ba \ge b) semi-axes aa and bb, foci at (±c,0)(\pm c, 0) with c2=a2−b2c^2 = a^2 - b^2
Parabola y=x2/(4p)y = x^2/(4p), or x2=4pyx^2 = 4py focus (0,p)(0, p), directrix y=−py = -p
Hyperbola x2/a2−y2/b2=1x^2/a^2 - y^2/b^2 = 1 foci at (±c,0)(\pm c, 0) with c2=a2+b2c^2 = a^2 + b^2, asymptotes y=±(b/a)xy = \pm(b/a)x

To move the centre to (h,k)(h, k), replace xx by x−hx - h and yy by y−ky - k, exactly as in Graph Transformations.

Completing the square turns a general equation into standard form:

x2+4y2−6x+8y+9=0(x2−6x+9)+4(y2+2y+1)=−9+9+4(x−3)2+4(y+1)2=4(x−3)24+(y+1)21=1ellipse, centre (3,−1), a=2, b=1\begin{aligned} x^2 + 4y^2 - 6x + 8y + 9 &= 0 \\ (x^2 - 6x + 9) + 4(y^2 + 2y + 1) &= -9 + 9 + 4 \\ (x - 3)^2 + 4(y + 1)^2 &= 4 \\ \frac{(x - 3)^2}{4} + \frac{(y + 1)^2}{1} &= 1 && \text{ellipse, centre } (3, -1),\ a = 2,\ b = 1 \end{aligned}

Focus and eccentricity

Each conic has a geometric definition through its foci:

  • Ellipse: the sum of the distances to the two foci is constant (=2a= 2a). Tie a loop of string around two pins and trace with a pencil.
  • Hyperbola: the difference of the distances to the two foci is constant (=2a= 2a).
  • Parabola: the distance to the focus equals the distance to the directrix line.

The eccentricity ee measures how stretched a conic is: e=c/ae = c/a for ellipses and hyperbolas.

ee Curve
0 circle
0<e<10 < e < 1 ellipse
1 parabola
e>1e > 1 hyperbola
python · try it yourself
import math

a, b = 5.0, 3.0
c = math.sqrt(a**2 - b**2)
print(f"ellipse a = {a}, b = {b}: c = {c}, e = {c / a}")

for t in [0.0, 0.7, 1.9, 3.0, 4.4]:
    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}")
ellipse a = 5.0, b = 3.0: c = 4.0, e = 0.8
point ( 5.000,  0.000): d1 + d2 = 10.000000
point ( 3.824,  1.933): d1 + d2 = 10.000000
point (-1.616,  2.839): d1 + d2 = 10.000000
point (-4.950,  0.423): d1 + d2 = 10.000000
point (-1.537, -2.855): d1 + d2 = 10.000000

The points were generated with the parametric form (acos⁡t,bsin⁡t)(a\cos t, b\sin t), the easiest way to draw an ellipse in code. Every one of them has the same distance sum 2a=102a = 10.

Drawing all four

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

t = np.linspace(0, 2 * np.pi, 400)
s = np.linspace(-1.5, 1.5, 200)

plt.figure(figsize=(6, 4))
plt.plot(2 * np.cos(t), 2 * np.sin(t), label="circle x² + y² = 4")
plt.plot(4 * np.cos(t), 2 * np.sin(t), label="ellipse x²/16 + y²/4 = 1")
xp = np.linspace(-4, 4, 200)
plt.plot(xp, xp**2 / 4 - 3, label="parabola y = x²/4 − 3")
plt.plot(np.cosh(s), np.sinh(s) * 2, "C3", label="hyperbola x² − y²/4 = 1")
plt.plot(-np.cosh(s), np.sinh(s) * 2, "C3")
plt.gca().set_aspect("equal"); plt.xlim(-5, 5); plt.ylim(-4, 4)
plt.grid(alpha=0.3); plt.legend(fontsize=7, loc="lower right")
plt.title("The four conic sections")

x, y = np.cosh(1.2), 2 * np.sinh(1.2)
print("hyperbola point check:", round(x**2 - y**2 / 4, 10))
hyperbola point check: 1.0

The hyperbola is drawn with (cosh⁡s,bsinh⁡s)(\cosh s, b\sinh s), using the identity cosh⁡2−sinh⁡2=1\cosh^2 - \sinh^2 = 1 from Hyperbolic Functions.

In software

  • Orbits: planets, moons and satellites move on ellipses with the central body at one focus (Kepler's first law). Earth's orbit has e≈0.017e \approx 0.017, nearly a circle; a comet on an escape path follows a parabola or a hyperbola. Orbit simulators and space games use these formulas directly.
  • Projectiles: without air resistance, a thrown object follows a parabola, y=y0+vyt−12gt2y = y_0 + v_y t - \frac{1}{2}gt^2.
  • Collision tests: a point (px,py)(p_x, p_y) is inside an axis-aligned ellipse with centre (h,k)(h, k) when (px−h)2/a2+(py−k)2/b2≤1(p_x - h)^2/a^2 + (p_y - k)^2/b^2 \le 1. That is one line of code, much cheaper than a polygon test, and is used for elliptical hitboxes and selection areas (Circles and Spheres).
  • Optics and antennas: a parabolic mirror sends every ray arriving parallel to its axis to the focus, which is why satellite dishes and car headlights are parabolic. An ellipse reflects rays from one focus to the other.
  • GPS-style positioning: a fixed difference in arrival time of a signal at two receivers places the source on a hyperbola.
python · try it yourself
def in_ellipse(px, py, h, k, a, b):
    return (px - h)**2 / a**2 + (py - k)**2 / b**2 <= 1

hitbox = dict(h=10, k=5, a=4, b=2)       # a wide, flat enemy
for p in [(10, 5), (13.5, 5), (13, 6.5), (10, 7.5)]:
    print(p, "hit" if in_ellipse(*p, **hitbox) else "miss")
(10, 5) hit
(13.5, 5) hit
(13, 6.5) miss
(10, 7.5) miss

For (13,6.5)(13, 6.5): 9/16+2.25/4=0.5625+0.5625=1.125>19/16 + 2.25/4 = 0.5625 + 0.5625 = 1.125 > 1, just outside.

Exercises

Exercise 1: Identify the conic

Name each curve: (a) 9x2+4y2=369x^2 + 4y^2 = 36, (b) y2−x2=1y^2 - x^2 = 1, (c) x2+y2−10y=0x^2 + y^2 - 10y = 0, (d) y=3x2−1y = 3x^2 - 1.

Answer

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

Solution
  • (a) Both squared terms positive with different coefficients: ellipse, x2/4+y2/9=1x^2/4 + y^2/9 = 1.
  • (b) Opposite signs: a hyperbola opening up and down.
  • (c) Equal coefficients: completing the square gives x2+(y−5)2=25x^2 + (y - 5)^2 = 25, a circle with centre (0,5)(0, 5) and radius 5.
  • (d) Only xx is squared: a parabola.

Exercise 2: Foci of an ellipse

Find the foci and the eccentricity of x2/25+y2/16=1x^2/25 + y^2/16 = 1.

Answer

Foci (±3,0)(\pm 3, 0), e=0.6e = 0.6.

Solution
a2=25, b2=16  ⇒  c2=25−16=9  ⇒  c=3e=c/a=3/5=0.6\begin{aligned} &a^2 = 25,\ b^2 = 16 \;\Rightarrow\; c^2 = 25 - 16 = 9 \;\Rightarrow\; c = 3 \\ &e = c/a = 3/5 = 0.6 \end{aligned}

Exercise 3: Complete the square

Put x2+y2+4x−6y−3=0x^2 + y^2 + 4x - 6y - 3 = 0 into standard form and give the centre and radius.

Answer

(x+2)2+(y−3)2=16(x + 2)^2 + (y - 3)^2 = 16: centre (−2,3)(-2, 3), radius 4.

Solution
(x2+4x+4)+(y2−6y+9)=3+4+9(x+2)2+(y−3)2=16\begin{aligned} (x^2 + 4x + 4) + (y^2 - 6y + 9) &= 3 + 4 + 9 \\ (x + 2)^2 + (y - 3)^2 &= 16 \end{aligned}
python · try it yourself
import sympy as sp

x, y = sp.symbols('x y')
lhs = x**2 + y**2 + 4*x - 6*y - 3
print(sp.expand((x + 2)**2 + (y - 3)**2 - 16 - lhs))
0

Exercise 4: Parabola focus

A satellite dish has the cross-section y=x2/120y = x^2/120 (in cm). How far above the vertex should the receiver sit?

Answer

30 cm, at the focus (0,30)(0, 30).

Solution

Compare with y=x2/(4p)y = x^2/(4p): 4p=1204p = 120, so p=30p = 30. The focus is at (0,p)=(0,30)(0, p) = (0, 30).

Exercise 5: Ellipse–point test with a rotated ellipse

An ellipse centred at the origin with semi-axes a=3a = 3, b=1b = 1 is rotated 30° counterclockwise. Is the point (2,1.5)(2, 1.5) inside? (Rotate the point by −30° first, then use the axis-aligned test.)

Answer

Yes; after rotating, the point is (2.4821,0.299)(2.4821, 0.299) and the test value is about 0.7739, which is ≤1\le 1.

Solution

Rotating the point by −30° puts it in the ellipse's own coordinate frame:

python · try it yourself
import math

px, py = 2, 1.5
t = math.radians(-30)
u = px * math.cos(t) - py * math.sin(t)
v = px * math.sin(t) + py * math.cos(t)
value = u**2 / 3**2 + v**2 / 1**2
print(round(u, 4), round(v, 4), round(value, 4), value <= 1)
2.4821 0.299 0.7739 True

Test yourself

Which conic has eccentricity exactly 1?

  1. Circle
  2. Ellipse
  3. Parabola
  4. Hyperbola

For the ellipse x2/a2+y2/b2=1x^2/a^2 + y^2/b^2 = 1 with a>ba > b, where are the foci?

  1. (±a,0)(\pm a, 0)
  2. (0,±b)(0, \pm b)
  3. (±a2+b2,0)(\pm\sqrt{a^2 + b^2}, 0)
  4. (±a2−b2,0)(\pm\sqrt{a^2 - b^2}, 0)

In which shape do planets orbit the Sun, according to Kepler's first law?

  1. A circle with the Sun at the centre
  2. An ellipse with the Sun at one focus
  3. A parabola
  4. An ellipse with the Sun at the centre