TExcelTAD
Home › Pre-Calculus, Geometry & Trigonometry › Parametric Equations

Parametric Equations

A parametric curve describes a path by giving xx and yy separately as functions of a third variable, usually time tt. Instead of "yy as a function of xx", you get "where the object is at time tt". This lesson shows how to write and graph parametric equations, how to eliminate the parameter, and why game objects, animations and particle effects are naturally parametric.

x(t)x(t) and y(t)y(t)

A parametric curve is a pair of functions

x=f(t),y=g(t),for t in some intervalx = f(t), \quad y = g(t), \quad \text{for } t \text{ in some interval}

The variable tt is the parameter. Each value of tt gives one point (f(t),g(t))(f(t), g(t)); as tt increases, the point traces out the curve in a particular direction. That direction and speed are extra information a plain equation in xx and yy does not carry.

Parametric equations Curve
x=1+2tx = 1 + 2t, y=3−ty = 3 - t a line through (1,3)(1, 3) with direction (2,−1)(2, -1)
x=cos⁡tx = \cos t, y=sin⁡ty = \sin t, 0≤t<2π0 \le t < 2\pi unit circle, counter-clockwise
x=3cos⁡tx = 3\cos t, y=2sin⁡ty = 2\sin t ellipse x29+y24=1\frac{x^2}{9} + \frac{y^2}{4} = 1
x=tx = t, y=t2y = t^2 the parabola y=x2y = x^2
x=t−sin⁡tx = t - \sin t, y=1−cos⁡ty = 1 - \cos t cycloid (a point on a rolling wheel)

Parametric equations can draw curves that fail the vertical line test, such as a full circle or a loop, which no single function y=f(x)y = f(x) can.

Eliminating the parameter

To find an ordinary equation for the curve, solve one equation for tt and substitute, or use an identity:

x=1+2t, y=3−t:t=x−12  ⇒  y=3−x−12=3.5−x2x=3cos⁡t, y=2sin⁡t:cos⁡t=x3, sin⁡t=y2,cos⁡2t+sin⁡2t=1  ⇒  x29+y24=1\begin{aligned} x = 1 + 2t,\ y = 3 - t&: \quad t = \frac{x - 1}{2} \;\Rightarrow\; y = 3 - \frac{x - 1}{2} = 3.5 - \frac{x}{2} \\ x = 3\cos t,\ y = 2\sin t&: \quad \cos t = \frac{x}{3},\ \sin t = \frac{y}{2}, \\ &\quad \cos^2 t + \sin^2 t = 1 \;\Rightarrow\; \frac{x^2}{9} + \frac{y^2}{4} = 1 \end{aligned}

Different parametrisations can trace the same curve: x=cos⁡2tx = \cos 2t, y=sin⁡2ty = \sin 2t is the same unit circle, travelled twice as fast. x=cos⁡tx = \cos t, y=−sin⁡ty = -\sin t is the same circle clockwise.

Projectile motion

A ball launched at speed vv and angle α\alpha under gravity gg (no air resistance) follows

x(t)=vcos⁡α⋅ty(t)=vsin⁡α⋅t−12gt2\begin{aligned} x(t) &= v\cos\alpha \cdot t \\ y(t) &= v\sin\alpha \cdot t - \tfrac{1}{2} g t^2 \end{aligned}

The horizontal motion is uniform; the vertical motion is the falling-body formula. Eliminating tt gives a parabola, a conic section. The parametric form answers the questions a game needs directly: where is the ball at frame tt, when does it land, how high does it go?

python · try it yourself
import math

v, alpha, g = 20.0, math.radians(40), 9.81
vx, vy = v * math.cos(alpha), v * math.sin(alpha)

t_land = 2 * vy / g                 # y(t) = 0 again
t_top = vy / g
print(f"flight time {t_land:.3f} s, peak {vy**2 / (2 * g):.3f} m at t = {t_top:.3f} s, range {vx * t_land:.3f} m")

print("   t      x       y")
for k in range(6):
    t = t_land * k / 5
    print(f"{t:5.2f} {vx * t:7.2f} {vy * t - 0.5 * g * t**2:7.2f}")
flight time 2.621 s, peak 8.424 m at t = 1.310 s, range 40.155 m
   t      x       y
 0.00    0.00    0.00
 0.52    8.03    5.39
 1.05   16.06    8.09
 1.57   24.09    8.09
 2.10   32.12    5.39
 2.62   40.16    0.00

In software: paths for game objects

Games and animation code are full of parametric paths:

  • Moving along a line. P(t)=A+t⋅(B−A)P(t) = A + t \cdot (B - A) for 0≤t≤10 \le t \le 1 goes from AA to BB. This is linear interpolation, the basis of lerp, and with an easing function applied to tt it becomes smooth UI animation.
  • Orbits and patrols. A moon orbiting a planet at (cx,cy)(c_x, c_y): x=cx+Rcos⁡(ωt)x = c_x + R\cos(\omega t), y=cy+Rsin⁡(ωt)y = c_y + R\sin(\omega t). Changing ω\omega changes the speed, the sign of ω\omega the direction.
  • Figure-eights and Lissajous curves. x=Asin⁡(at)x = A\sin(at), y=Bsin⁡(bt)y = B\sin(bt) give looping patrol routes and screensaver patterns.
  • Bézier curves. The curves in vector drawing programs and font outlines are parametric polynomials in tt (Bézier Curves).
python · try it yourself
import numpy as np
import matplotlib.pyplot as plt

t = np.linspace(0, 2 * np.pi, 500)
plt.figure(figsize=(6, 4))
plt.plot(3 * np.sin(t), 2 * np.sin(2 * t), label="patrol: x = 3 sin t, y = 2 sin 2t")
plt.plot(1.2 * np.cos(t) + 4.5, 1.2 * np.sin(t), label="orbit: circle around (4.5, 0)")
s = np.linspace(0, 4 * np.pi, 400)
plt.plot(0.5 * (s - np.sin(s)) - 3, 0.5 * (1 - np.cos(s)) - 3, label="cycloid (rolling wheel)")
for k in range(0, 500, 50):          # sample positions = frames
    plt.plot(3 * np.sin(t[k]), 2 * np.sin(2 * t[k]), "k.", ms=6)
plt.gca().set_aspect("equal")
plt.legend(fontsize=8, loc="upper left")
xs = 3 * np.sin(t[::50])
print("frame x positions:", [round(float(v), 2) for v in xs])
frame x positions: [0.0, 1.77, 2.86, 2.85, 1.75, -0.02, -1.78, -2.86, -2.84, -1.74]

The black dots are equally spaced in tt, not in distance: the object moves faster where the dots are far apart. Game code that needs constant speed along a curve has to reparametrise by arc length, a topic for calculus (Parametric Curves, Calculus with Parametric Curves).

Exercises

Exercise 1: Eliminate tt

Eliminate the parameter from x=t+2x = t + 2, y=t2−1y = t^2 - 1.

Answer

y=(x−2)2−1y = (x - 2)^2 - 1, a parabola with vertex (2,−1)(2, -1).

Solution
t=x−2  ⇒  y=(x−2)2−1t = x - 2 \;\Rightarrow\; y = (x - 2)^2 - 1

Exercise 2: Parametrise a segment

Write parametric equations for the segment from A=(−1,4)A = (-1, 4) to B=(5,1)B = (5, 1), with tt from 0 to 1. Where is the point at t=1/3t = 1/3?

Answer

x=−1+6tx = -1 + 6t, y=4−3ty = 4 - 3t; at t=1/3t = 1/3 the point is (1,3)(1, 3).

Solution
B−A=(6,−3),P(t)=A+t(B−A)=(−1+6t,4−3t)t=1/3:(−1+2,4−1)=(1,3)\begin{aligned} &B - A = (6, -3), \quad P(t) = A + t(B - A) = (-1 + 6t, 4 - 3t) \\ &t = 1/3{:}\quad (-1 + 2, 4 - 1) = (1, 3) \end{aligned}

Exercise 3: Identify the curve

What curve is x=2+5cos⁡tx = 2 + 5\cos t, y=−1+5sin⁡ty = -1 + 5\sin t, and in which direction is it traced?

Answer

The circle (x−2)2+(y+1)2=25(x - 2)^2 + (y + 1)^2 = 25, counter-clockwise.

Solution
cos⁡t=x−25,sin⁡t=y+15,and cos⁡2+sin⁡2=1⇒(x−2)2+(y+1)2=25As t grows from 0, the point starts at (7,−1) and moves up: counter-clockwise.\begin{aligned} &\cos t = \frac{x - 2}{5},\quad \sin t = \frac{y + 1}{5},\quad \text{and } \cos^2 + \sin^2 = 1 \\ &\Rightarrow (x - 2)^2 + (y + 1)^2 = 25 \\ &\text{As } t \text{ grows from 0, the point starts at } (7, -1) \text{ and moves up: counter-clockwise.} \end{aligned}

Exercise 4: When does it land?

A ball leaves a 10 m high cliff with velocity (8,6) m/s(8, 6)\ \text{m/s}, so x=8tx = 8t, y=10+6t−4.9t2y = 10 + 6t - 4.9t^2. When does it hit the ground and how far from the cliff? Check numerically.

Answer

t≈2.166 st \approx 2.166\ \text{s}, at x≈17.33 mx \approx 17.33\ \text{m}.

Solution
y=0:4.9t2−6t−10=0t=6+36+1969.8=6+2329.8≈6+15.2329.8≈2.166(the other root is negative)x=8⋅2.166≈17.33\begin{aligned} y = 0{:}\quad & 4.9t^2 - 6t - 10 = 0 \\ t &= \frac{6 + \sqrt{36 + 196}}{9.8} = \frac{6 + \sqrt{232}}{9.8} \approx \frac{6 + 15.232}{9.8} \approx 2.166 && \text{(the other root is negative)} \\ x &= 8 \cdot 2.166 \approx 17.33 \end{aligned}
python · try it yourself
import math

t = (6 + math.sqrt(36 + 4 * 4.9 * 10)) / (2 * 4.9)
print(round(t, 3), round(8 * t, 2), round(10 + 6 * t - 4.9 * t**2, 9))
2.166 17.33 0.0

Test yourself

Which curve is x=4cos⁡tx = 4\cos t, y=4sin⁡ty = 4\sin t?

  1. A line
  2. A circle of radius 4
  3. A parabola
  4. An ellipse with a=4a = 4, b=2b = 2

What does P(t)=A+t(B−A)P(t) = A + t(B - A) give at t=0.5t = 0.5?

  1. Point AA
  2. Point BB
  3. The midpoint of AA and BB
  4. A point beyond BB

x=cos⁡tx = \cos t, y=−sin⁡ty = -\sin t traces the unit circle…

  1. clockwise
  2. counter-clockwise
  3. only half of it
  4. twice per 2π2\pi