TExcelTAD
Home › Calculus in Depth › Conic Sections in Polar Coordinates

Conic Sections in Polar Coordinates

Put a focus at the origin and every conic, ellipse, parabola or hyperbola, has the same one-line polar equation, with the eccentricity ee deciding which one you get. That equation is exactly the shape of a planetary orbit, which is why this lesson ends with Kepler's laws and an orbit simulation.

One definition for all three conics

Theorem. Let FF be a point (the focus), ll a line not through FF (the directrix) and e>0e > 0 a constant. The set of points PP with

∣PF∣∣Pl∣=e\frac{\lvert PF \rvert}{\lvert Pl \rvert} = e

is an ellipse if e<1e < 1, a parabola if e=1e = 1 and a hyperbola if e>1e > 1.

Proof sketch. Put FF at the origin and the directrix at x=dx = d (d>0d > 0). For PP with polar coordinates (r,θ)(r, \theta), ∣PF∣=r\lvert PF \rvert = r and ∣Pl∣=d−rcos⁡θ\lvert Pl \rvert = d - r\cos\theta (for points on the focus side). The condition r=e(d−rcos⁡θ)r = e(d - r\cos\theta) rearranges to

r=ed1+ecos⁡θr = \frac{ed}{1 + e\cos\theta}

Converting back to Cartesian, r=e(d−x)r = e(d - x) squares to x2+y2=e2(d−x)2x^2 + y^2 = e^2(d - x)^2, i.e.

(1−e2)x2+2e2d x+y2=e2d2(1 - e^2)x^2 + 2e^2d\,x + y^2 = e^2d^2

If e=1e = 1 the x2x^2 term vanishes and this is a parabola. If e≠1e \ne 1, completing the square gives

(x−h)2a2+y2a2(1−e2)=1,h=−e2d1−e2,a2=e2d2(1−e2)2\frac{(x - h)^2}{a^2} + \frac{y^2}{a^2(1 - e^2)} = 1, \qquad h = -\frac{e^2d}{1 - e^2}, \qquad a^2 = \frac{e^2d^2}{(1 - e^2)^2}

For e<1e < 1 both denominators are positive (an ellipse); for e>1e > 1 the y2y^2 denominator is negative (a hyperbola). One also checks c=∣h∣=e⋅ac = \lvert h \rvert = e \cdot a, so the ee here is the same eccentricity c/ac/a as in Conic Sections. ∎

Directrix Polar equation
x=dx = d (right of focus) r=ed1+ecos⁡θr = \frac{ed}{1 + e\cos\theta}
x=−dx = -d (left) r=ed1−ecos⁡θr = \frac{ed}{1 - e\cos\theta}
y=dy = d (above) r=ed1+esin⁡θr = \frac{ed}{1 + e\sin\theta}
y=−dy = -d (below) r=ed1−esin⁡θr = \frac{ed}{1 - e\sin\theta}

Tip: To read r=104+3cos⁡θr = \frac{10}{4 + 3\cos\theta}, divide top and bottom by 4: r=2.51+0.75cos⁡θr = \frac{2.5}{1 + 0.75\cos\theta}. So e=0.75e = 0.75 (ellipse) and ed=2.5ed = 2.5, d=10/3d = 10/3.

Orbits: the ellipse form

For an ellipse it is more natural to use the semi-major axis aa than dd. From a2=e2d2(1−e2)2a^2 = \frac{e^2d^2}{(1 - e^2)^2} we get ed=a(1−e2)ed = a(1 - e^2), so

r(θ)=a(1−e2)1+ecos⁡θr(\theta) = \frac{a(1 - e^2)}{1 + e\cos\theta}

θ=0\theta = 0 gives the closest point, perihelion r=a(1−e)r = a(1 - e); θ=π\theta = \pi gives the farthest, aphelion r=a(1+e)r = a(1 + e). The quantity p=a(1−e2)p = a(1 - e^2) is the semi-latus rectum (rr at θ=±π/2\theta = \pm\pi/2).

Kepler's laws (derived by Newton from the inverse-square law, see Motion in Space):

  1. A planet moves on an ellipse with the Sun at one focus: the equation above.
  2. The radius vector sweeps equal areas in equal times. In polar form dAdt=12r2dθdt=h2\frac{dA}{dt} = \frac{1}{2}r^2\frac{d\theta}{dt} = \frac{h}{2}, the polar area formula from Areas and Lengths in Polar Coordinates, with h=∣r×v∣h = \lvert \mathbf{r} \times \mathbf{v} \rvert constant (angular momentum per unit mass).
  3. T2=4π2GMa3T^2 = \frac{4\pi^2}{GM} a^3.
python · try it yourself
import math

a_au, e = 1.0, 0.0167          # Earth: semi-major axis 1 AU, eccentricity about 0.0167
AU = 1.496e8                   # km
for name, th in [("perihelion", 0.0), ("quarter", math.pi / 2), ("aphelion", math.pi)]:
    r = a_au * (1 - e**2) / (1 + e * math.cos(th))
    print(f"{name:10s} r = {r:.5f} AU = {r * AU / 1e6:.2f} million km")

# Kepler's third law: Mars has a ≈ 1.524 AU, so T = a^1.5 years (Sun's GM in AU³/yr² is 4π²)
print(f"Mars period ≈ {1.524**1.5:.3f} years")
perihelion r = 0.98330 AU = 147.10 million km
quarter    r = 0.99972 AU = 149.56 million km
aphelion   r = 1.01670 AU = 152.10 million km
Mars period ≈ 1.881 years

Simulating an orbit

The polar equation is the analytic answer; a simulation integrates Newton's law r′′=−GM r/∣r∣3\mathbf{r}'' = -GM\,\mathbf{r}/\lvert \mathbf{r} \rvert^3 step by step and should reproduce it. Use units with GM=1GM = 1, start at (1,0)(1, 0) moving straight up at speed 1.2. Then h=1.2h = 1.2, p=h2/GM=1.44p = h^2/GM = 1.44, and since the start is the perihelion, 1=p1+e1 = \frac{p}{1 + e} gives e=0.44e = 0.44 and a=p1−e2=1.786a = \frac{p}{1 - e^2} = 1.786.

python · try it yourself
import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt

def gravity(t, s):
    x, y, vx, vy = s
    r3 = (x*x + y*y) ** 1.5
    return [vx, vy, -x / r3, -y / r3]

T = 2 * np.pi * 1.7857142857**1.5            # Kepler's third law with GM = 1
sol = solve_ivp(gravity, (0, T), [1, 0, 0, 1.2], rtol=1e-10, atol=1e-12, dense_output=True)
t = np.linspace(0, T, 2000)
x, y = sol.sol(t)[:2]
r = np.hypot(x, y)
print(f"min r = {r.min():.6f}  max r = {r.max():.6f}")
print(f"e from the simulation = {(r.max() - r.min()) / (r.max() + r.min()):.6f}")
print(f"back at the start after one period: {abs(x[-1] - 1) < 1e-6 and abs(y[-1]) < 1e-6}")

th = np.arctan2(y, x)
pred = 1.44 / (1 + 0.44 * np.cos(th))
print(f"largest gap to r = p/(1 + e cos θ): {np.abs(r - pred).max():.1e}")
plt.figure(figsize=(6, 4))
plt.plot(x, y, label="simulated orbit"); plt.plot(0, 0, "o", label="focus (Sun)")
plt.axis("equal"); plt.legend()
print("plotted the orbit")
min r = 1.000000  max r = 2.571428
e from the simulation = 0.440000
back at the start after one period: True
largest gap to r = p/(1 + e cos θ): 8.3e-10
plotted the orbit

The numerical orbit closes after exactly the Kepler period and matches the polar conic to within the solver's tolerance. Raise the start speed to 2≈1.414\sqrt{2} \approx 1.414 (escape speed at r=1r = 1) and ee becomes 1: the orbit opens into a parabola; above that it is a hyperbola.

In software

  • Orbital mechanics in games (Kerbal-style map views): engines integrate the physics, but draw the predicted path from the conic r=p1+ecos⁡θr = \frac{p}{1 + e\cos\theta} computed from the current position and velocity, which is cheap and never drifts.
  • Astronomy and satellite software propagates orbits with Kepler's equation M=E−esin⁡EM = E - e\sin E, solved by Newton's method, to get position as a function of time.
  • Integrator testing: a Kepler orbit is a standard test for game physics integrators: explicit Euler spirals outward, symplectic Euler keeps the ellipse closed for a very long time.

Exercises

Exercise 1: Read the conic

Identify r=123−6sin⁡θr = \frac{12}{3 - 6\sin\theta}: eccentricity, type and directrix.

Answer

e=2e = 2, a hyperbola, directrix y=−2y = -2.

Solution
r=41−2sin⁡θ:e=2, ed=4  ⇒  d=2“−sin⁡θ” form  ⇒  directrix below the focus: y=−2\begin{aligned} &r = \frac{4}{1 - 2\sin\theta}{:} \quad e = 2,\ ed = 4 \;\Rightarrow\; d = 2 \\ &\text{“}{-\sin\theta}\text{” form} \;\Rightarrow\; \text{directrix below the focus: } y = -2 \end{aligned}

Exercise 2: Write the equation

Find a polar equation of the parabola with focus at the origin and directrix x=−5x = -5.

Answer

r=51−cos⁡θr = \frac{5}{1 - \cos\theta}.

Solution

e=1e = 1, d=5d = 5, directrix to the left ⇒\Rightarrow r=ed1−ecos⁡θ=51−cos⁡θr = \frac{ed}{1 - e\cos\theta} = \frac{5}{1 - \cos\theta}. Check θ=π\theta = \pi: r=2.5r = 2.5, the vertex halfway between the focus and the directrix.

Exercise 3: A comet

A comet has perihelion 0.6 AU and aphelion 35 AU. Find ee, aa and its period in years.

Answer

e≈0.9663e \approx 0.9663, a=17.8 AUa = 17.8\ \text{AU}, T≈75.1 yearsT \approx 75.1\ \text{years}.

Solution
a(1−e)=0.6, a(1+e)=35  ⇒  2a=35.6, a=17.8e=35−0.635+0.6=34.435.6T=a3/2 years (Sun, AU units)\begin{aligned} &a(1 - e) = 0.6,\ a(1 + e) = 35 \;\Rightarrow\; 2a = 35.6,\ a = 17.8 \\ &e = \frac{35 - 0.6}{35 + 0.6} = \frac{34.4}{35.6} \\ &T = a^{3/2} \text{ years (Sun, AU units)} \end{aligned}
python · try it yourself
a = (35 + 0.6) / 2
e = (35 - 0.6) / (35 + 0.6)
print(f"a = {a}, e = {e:.4f}, T = {a**1.5:.1f} years")
a = 17.8, e = 0.9663, T = 75.1 years

Exercise 4: Equal areas

For the orbit r=1.441+0.44cos⁡θr = \frac{1.44}{1 + 0.44\cos\theta}, compute the area swept from θ=0\theta = 0 to π/2\pi/2 and from θ=π/2\theta = \pi/2 to π\pi. Which arc takes longer to travel?

Answer

About 1.0310 and 3.4670; the second arc (farther from the Sun) takes about 3.36 times as long.

Solution

By Kepler's second law time is proportional to swept area, and area=∫12r2 dθ\text{area} = \int \frac{1}{2}r^2\,d\theta.

python · try it yourself
import numpy as np
from scipy.integrate import quad

r = lambda t: 1.44 / (1 + 0.44 * np.cos(t))
A1, _ = quad(lambda t: r(t)**2 / 2, 0, np.pi / 2)
A2, _ = quad(lambda t: r(t)**2 / 2, np.pi / 2, np.pi)
print(f"{A1:.4f} {A2:.4f} ratio {A2 / A1:.2f}")
1.0310 3.4670 ratio 3.36

Test yourself

What conic is r=31+0.5cos⁡θr = \frac{3}{1 + 0.5\cos\theta}?

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

An orbit has a=2a = 2 and e=0.5e = 0.5. What is the perihelion distance?

  1. 1
  2. 1.5
  3. 3
  4. 0.5

Kepler's second law in polar coordinates says which quantity is constant?

  1. rr
  2. dθ/dtd\theta/dt
  3. dr/dtdr/dt
  4. r2 dθ/dtr^2\,d\theta/dt