TExcelTAD
Home › Calculus Essentials › Motion in Space

Motion in Space

When an object moves, its position is a vector that changes with time. Differentiating gives the velocity, differentiating again gives the acceleration, and integrating runs the chain backwards. This lesson applies the curve tools of the last lesson to projectiles, circular motion and game physics.

Position, velocity, acceleration

If r(t)\mathbf{r}(t) is the position at time tt, then:

Quantity Formula Kind
Position r(t)=⟨x(t),y(t),z(t)⟩\mathbf{r}(t) = \langle x(t), y(t), z(t) \rangle vector
Velocity v(t)=r′(t)\mathbf{v}(t) = \mathbf{r}'(t) vector, tangent to the path
Speed ∥v(t)∥\lVert \mathbf{v}(t) \rVert scalar, never negative
Acceleration a(t)=v′(t)=r′′(t)\mathbf{a}(t) = \mathbf{v}'(t) = \mathbf{r}''(t) vector
Distance travelled from t0t_0 to t1t_1 ∫t0t1∥v(t)∥ dt\int_{t_0}^{t_1} \lVert \mathbf{v}(t) \rVert \, dt scalar (arc length)

Each component is differentiated on its own, exactly as in the one-dimensional curvilinear motion lesson. Going the other way, integrating a(t)\mathbf{a}(t) gives v(t)\mathbf{v}(t) up to a constant vector (the initial velocity), and integrating again gives r(t)\mathbf{r}(t) up to the initial position.

Projectile motion

Near the ground, gravity gives a constant acceleration a=⟨0,−g⟩\mathbf{a} = \langle 0, -g \rangle with g≈9.8 m/s2g \approx 9.8\ \text{m/s}^2. Integrate twice with initial position r0=⟨0,h⟩\mathbf{r}_0 = \langle 0, h \rangle and initial velocity v0=⟨vcos⁡α,vsin⁡α⟩\mathbf{v}_0 = \langle v\cos\alpha, v\sin\alpha \rangle:

v(t)=⟨vcos⁡α, vsin⁡α−gt⟩r(t)=⟨vcos⁡α⋅t, h+vsin⁡α⋅t−12gt2⟩\begin{aligned} \mathbf{v}(t) &= \langle v\cos\alpha,\ v\sin\alpha - gt \rangle \\ \mathbf{r}(t) &= \langle v\cos\alpha \cdot t,\ h + v\sin\alpha \cdot t - \tfrac{1}{2} g t^2 \rangle \end{aligned}

The horizontal velocity never changes; only the vertical part feels gravity.

python · try it yourself
import sympy as sp

t = sp.symbols('t', nonnegative=True)
g, v0, alpha = sp.Rational(98, 10), 20, sp.pi / 6     # 20 m/s at 30°

a = sp.Matrix([0, -g])
vel = sp.Matrix([v0 * sp.cos(alpha), v0 * sp.sin(alpha)]) + a.integrate(t)
pos = vel.integrate(t)                                    # launched from the origin

print("v(t) =", list(vel))
print("r(t) =", list(pos))
t_land = sp.solve(sp.Eq(pos[1], 0), t)
t_land = [s for s in t_land if s > 0][0]
print("lands at t =", t_land, "≈", round(float(t_land), 3), "s")
print("range      ≈", round(float(pos[0].subs(t, t_land)), 3), "m")
t_top = sp.solve(sp.Eq(vel[1], 0), t)[0]
print("max height ≈", round(float(pos[1].subs(t, t_top)), 3), "m")
v(t) = [10*sqrt(3), 10 - 49*t/5]
r(t) = [10*sqrt(3)*t, -49*t**2/10 + 10*t]
lands at t = 100/49 ≈ 2.041 s
range      ≈ 35.348 m
max height ≈ 5.102 m

The top of the arc is where the vertical velocity is zero, at exactly half the flight time.

Circular motion

A point moving round a circle of radius RR at constant angular speed ω\omega has

r(t)=⟨Rcos⁡ωt,Rsin⁡ωt⟩v(t)=⟨−Rωsin⁡ωt,Rωcos⁡ωt⟩speed ∥v∥=Rωa(t)=⟨−Rω2cos⁡ωt,−Rω2sin⁡ωt⟩=−ω2r(t)\begin{aligned} \mathbf{r}(t) &= \langle R\cos\omega t, R\sin\omega t \rangle \\ \mathbf{v}(t) &= \langle -R\omega\sin\omega t, R\omega\cos\omega t \rangle && \text{speed } \lVert \mathbf{v} \rVert = R\omega \\ \mathbf{a}(t) &= \langle -R\omega^2\cos\omega t, -R\omega^2\sin\omega t \rangle = -\omega^2 \mathbf{r}(t) \end{aligned}

The speed is constant, yet the acceleration is not zero: the direction of the velocity keeps changing. The acceleration points to the centre (centripetal) with size Rω2=∥v∥2/RR\omega^2 = \lVert \mathbf{v} \rVert^2/R. That is the force a car's tyres must supply in a bend.

Tangential and normal acceleration, curvature

In general, split the acceleration into a part along the velocity and a part perpendicular to it:

aT=v⋅a∥v∥changes the speedaN=∥v×a∥∥v∥changes the directionκ=∥v×a∥∥v∥3curvature: how sharply the path bends (1/radius)\begin{aligned} a_T &= \frac{\mathbf{v} \cdot \mathbf{a}}{\lVert \mathbf{v} \rVert} && \text{changes the speed} \\ a_N &= \frac{\lVert \mathbf{v} \times \mathbf{a} \rVert}{\lVert \mathbf{v} \rVert} && \text{changes the direction} \\ \kappa &= \frac{\lVert \mathbf{v} \times \mathbf{a} \rVert}{\lVert \mathbf{v} \rVert^3} && \text{curvature: how sharply the path bends (1/radius)} \end{aligned}

and aT2+aN2=∥a∥2a_T^2 + a_N^2 = \lVert \mathbf{a} \rVert^2. For a 2D path, use the cross product of ⟨vx,vy,0⟩\langle v_x, v_y, 0 \rangle and ⟨ax,ay,0⟩\langle a_x, a_y, 0 \rangle. On a circle of radius RR the curvature is 1/R1/R, so a gentle bend has a small κ\kappa.

python · try it yourself
import numpy as np

def decompose(v, a):
    v3, a3 = np.append(v, 0.0), np.append(a, 0.0)
    speed = np.linalg.norm(v3)
    aT = np.dot(v3, a3) / speed
    aN = np.linalg.norm(np.cross(v3, a3)) / speed
    kappa = np.linalg.norm(np.cross(v3, a3)) / speed**3
    return round(float(aT), 4), round(float(aN), 4), round(float(kappa), 4)

# circle R = 4, omega = 0.5, at t = 1
R, w, t = 4.0, 0.5, 1.0
v = np.array([-R*w*np.sin(w*t), R*w*np.cos(w*t)])
a = np.array([-R*w*w*np.cos(w*t), -R*w*w*np.sin(w*t)])
print("circle   aT, aN, kappa:", decompose(v, a), " expected kappa = 1/R =", 1 / R)

# projectile above at t = 0.5
v = np.array([10*np.sqrt(3), 10 - 9.8*0.5])
a = np.array([0.0, -9.8])
aT, aN, k = decompose(v, a)
print("projectile aT, aN, kappa:", (aT, aN, k), " check:", round(float(np.hypot(aT, aN)), 4))
circle   aT, aN, kappa: (0.0, 1.0, 0.25)  expected kappa = 1/R = 0.25
projectile aT, aN, kappa: (-2.7681, 9.4009, 0.0288)  check: 9.8

On the rising projectile, gravity both slows it down (negative aTa_T) and bends its path (aNa_N); together they rebuild g=9.8g = 9.8.

In software: simulating motion

A physics engine does not know r(t)\mathbf{r}(t) in closed form. It knows the forces, hence the acceleration, and steps velocity and position forward by a small dtdt each frame. This is numerical integration of the motion equations, covered in Numerical Solutions: Euler and RK4, Physics Integration in Game Loops and Game Physics' Integrators.

python · try it yourself
import numpy as np

g, dt = 9.8, 1 / 60                          # 60 frames per second
pos = np.array([0.0, 0.0])
vel = np.array([10 * np.sqrt(3), 10.0])

frames = 0
while True:
    vel = vel + np.array([0.0, -g]) * dt     # semi-implicit Euler
    new_pos = pos + vel * dt
    frames += 1
    if new_pos[1] < 0:
        break
    pos = new_pos
print("frames in the air:", frames, "→", round(frames * dt, 3), "s (exact 2.041 s)")
print("last x before landing:", round(pos[0], 3), "m (exact range 35.348 m)")
frames in the air: 122 → 2.033 s (exact 2.041 s)
last x before landing: 34.93 m (exact range 35.348 m)

The simulation is close but not exact, and the error shrinks as dtdt shrinks. Games also add drag, which has no neat closed-form solution, so numerical integration is the only practical option there.

Exercises

Exercise 1: Velocity and speed

r(t)=⟨t2,2t,ln⁡t⟩\mathbf{r}(t) = \langle t^2, 2t, \ln t \rangle for t>0t > 0. Find v(1)\mathbf{v}(1), the speed at t=1t = 1 and a(1)\mathbf{a}(1).

Answer

v(1)=⟨2,2,1⟩\mathbf{v}(1) = \langle 2, 2, 1 \rangle, speed 3, a(1)=⟨2,0,−1⟩\mathbf{a}(1) = \langle 2, 0, -1 \rangle.

Solution
v(t)=⟨2t,2,1/t⟩v(1)=⟨2,2,1⟩, ∥v(1)∥=4+4+1=3a(t)=⟨2,0,−1/t2⟩a(1)=⟨2,0,−1⟩\begin{aligned} \mathbf{v}(t) &= \langle 2t, 2, 1/t \rangle && \mathbf{v}(1) = \langle 2, 2, 1 \rangle,\ \lVert \mathbf{v}(1) \rVert = \sqrt{4 + 4 + 1} = 3 \\ \mathbf{a}(t) &= \langle 2, 0, -1/t^2 \rangle && \mathbf{a}(1) = \langle 2, 0, -1 \rangle \end{aligned}

Exercise 2: From acceleration to position

A drone has a(t)=⟨0,6t⟩\mathbf{a}(t) = \langle 0, 6t \rangle (m/s2\text{m/s}^2), v(0)=⟨2,0⟩\mathbf{v}(0) = \langle 2, 0 \rangle and r(0)=⟨1,1⟩\mathbf{r}(0) = \langle 1, 1 \rangle. Find r(t)\mathbf{r}(t) and r(2)\mathbf{r}(2).

Answer

r(t)=⟨1+2t,1+t3⟩\mathbf{r}(t) = \langle 1 + 2t, 1 + t^3 \rangle, so r(2)=⟨5,9⟩\mathbf{r}(2) = \langle 5, 9 \rangle.

Solution
v(t)=⟨0,3t2⟩+v(0)=⟨2,3t2⟩r(t)=⟨2t,t3⟩+r(0)=⟨1+2t,1+t3⟩r(2)=⟨5,9⟩\begin{aligned} \mathbf{v}(t) &= \langle 0, 3t^2 \rangle + \mathbf{v}(0) = \langle 2, 3t^2 \rangle \\ \mathbf{r}(t) &= \langle 2t, t^3 \rangle + \mathbf{r}(0) = \langle 1 + 2t, 1 + t^3 \rangle \\ \mathbf{r}(2) &= \langle 5, 9 \rangle \end{aligned}

Exercise 3: A car on a bend

A car drives at 20 m/s round a bend of radius 50 m. What is its centripetal acceleration, and what is the curvature of the bend?

Answer

8 m/s28\ \text{m/s}^2 toward the centre; κ=0.02\kappa = 0.02 per metre.

Solution

aN=∥v∥2/R=400/50=8 m/s2a_N = \lVert \mathbf{v} \rVert^2 / R = 400 / 50 = 8\ \text{m/s}^2. The curvature of a circle is 1/R=1/50=0.02 m−11/R = 1/50 = 0.02\ \text{m}^{-1}. Check with aN=κ∥v∥2a_N = \kappa \lVert \mathbf{v} \rVert^2: 0.02⋅400=80.02 \cdot 400 = 8.

Exercise 4: Smaller time steps (code)

Re-run the frame-by-frame projectile with dt=1/240dt = 1/240 and compare the landing time with the exact 100/49 s100/49\ \text{s}.

Answer

About 2.038 s, closer to 2.041 s than the 2.033 s from dt=1/60dt = 1/60.

Solution
python · try it yourself
import numpy as np
g, dt = 9.8, 1 / 240
pos, vel = np.array([0.0, 0.0]), np.array([10 * np.sqrt(3), 10.0])
frames = 0
while True:
    vel = vel + np.array([0.0, -g]) * dt
    new_pos = pos + vel * dt
    frames += 1
    if new_pos[1] < 0:
        break
    pos = new_pos
print(round(frames * dt, 4), "vs exact", round(100 / 49, 4))
2.0375 vs exact 2.0408

Four times more steps cut the error from about 0.008 s to about 0.003 s.

Test yourself

An object moves at constant speed around a circle. Its acceleration is…

  1. zero
  2. tangent to the circle
  3. directed toward the centre
  4. directed away from the centre

Which formula gives the speed?

  1. ∥r(t)∥\lVert \mathbf{r}(t) \rVert
  2. ∥r′(t)∥\lVert \mathbf{r}'(t) \rVert
  3. r′′(t)\mathbf{r}''(t)
  4. ∥r(t)∥′\lVert \mathbf{r}(t) \rVert'

If v⋅a<0\mathbf{v} \cdot \mathbf{a} < 0 at some moment, the object is…

  1. speeding up
  2. moving in a straight line
  3. slowing down
  4. at rest