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 is the position at time , then:
| Quantity | Formula | Kind |
|---|---|---|
| Position | vector | |
| Velocity | vector, tangent to the path | |
| Speed | scalar, never negative | |
| Acceleration | vector | |
| Distance travelled from to | scalar (arc length) |
Each component is differentiated on its own, exactly as in the one-dimensional curvilinear motion lesson. Going the other way, integrating gives up to a constant vector (the initial velocity), and integrating again gives up to the initial position.
Projectile motion
Near the ground, gravity gives a constant acceleration with . Integrate twice with initial position and initial velocity :
The horizontal velocity never changes; only the vertical part feels gravity.
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 at constant angular speed has
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 . 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:
and . For a 2D path, use the cross product of and . On a circle of radius the curvature is , so a gentle bend has a small .
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 ) and bends its path (); together they rebuild .
In software: simulating motion
A physics engine does not know in closed form. It knows the forces, hence the acceleration, and steps velocity and position forward by a small 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.
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 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
for . Find , the speed at and .
Answer
, speed 3, .
Solution
Exercise 2: From acceleration to position
A drone has (), and . Find and .
Answer
, so .
Solution
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
toward the centre; per metre.
Solution
. The curvature of a circle is . Check with : .
Exercise 4: Smaller time steps (code)
Re-run the frame-by-frame projectile with and compare the landing time with the exact .
Answer
About 2.038 s, closer to 2.041 s than the 2.033 s from .
Solution
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…
- zero
- tangent to the circle
- directed toward the centre
- directed away from the centre
Which formula gives the speed?
If at some moment, the object is…
- speeding up
- moving in a straight line
- slowing down
- at rest