Arc Length and Curvature
How long is a space curve, and how sharply does it bend? This lesson defines arc length, reparametrises curves by arc length so that "parameter" means "distance travelled", and builds the curvature , the normal and binormal vectors and the torsion : the Frenet frame, a coordinate system that rides along the curve. Road designers, roller-coaster engineers and camera-rail tools all work in this language.
The plane case of arc length is in Arc Length; a gentle introduction to curves in motion is Curvilinear Motion.
Arc length
For a curve , , with continuous and the curve traversed exactly once, the length is
Reason: a small parameter step moves the point by , a chord of length . Summing chords of a polygon inscribed in the curve and refining gives the integral. (Officially the length is the supremum of inscribed polygon lengths; for a curve the mean value theorem shows the supremum equals this integral.)
Arc length does not depend on the parametrisation: substituting with changes into by the chain rule, so the integral is unchanged.
Reparametrising by arc length
The arc length function measures distance travelled from :
For a smooth curve , so is strictly increasing and has an inverse . Then is the arc-length parametrisation: by the chain rule . The point moves at unit speed and the parameter literally is the distance along the curve. It is intrinsic: two people who parametrise the same curve differently (from the same start point and in the same direction) get the same .
Curvature
The unit tangent has constant length, so it can only turn. Curvature measures how fast it turns per unit of distance:
Three working formulas:
Proof of the cross-product formula. Write , so . Differentiate: . Then
has constant length, so (previous lesson), and . Hence , which is the formula.
Sanity checks: a line has constant, so . A circle of radius has : tight circles bend sharply, big ones barely.
The Frenet frame and torsion
Where , define
, and are mutually perpendicular unit vectors, a right-handed frame at every point. The osculating plane is spanned by and (the plane the curve "momentarily lies in"); the osculating circle lies in that plane, on the side, with radius , and matches the curve's position, tangent and curvature. is perpendicular to the osculating plane, and the rate at which it tips measures how the curve leaves the plane. Since is parallel to , one defines the torsion by . The Frenet–Serret formulas describe the whole frame's motion:
A plane curve has . By the fundamental theorem of curves, and determine a curve up to a rigid motion: they are its "DNA".
import sympy as sp
t = sp.symbols("t", real=True)
s = sp.symbols("s", positive=True)
r = sp.Matrix([4 * sp.cos(t), 4 * sp.sin(t), 3 * t]) # helix: radius 4, rise 3 per radian
d1, d2, d3 = r.diff(t), r.diff(t, 2), r.diff(t, 3)
speed = sp.simplify(d1.norm())
print("speed |r'| =", speed, " length of one turn =", sp.integrate(speed, (t, 0, 2 * sp.pi)))
rs = r.subs(t, s / speed) # s = 5t, so t = s/5
print("r(s) =", list(rs), " |dr/ds| =", sp.simplify(rs.diff(s).norm()))
c = d1.cross(d2)
kappa = sp.simplify(c.norm() / speed**3)
tau = sp.simplify(c.dot(d3) / c.norm()**2)
print("curvature =", kappa, " torsion =", tau)speed |r'| = 5 length of one turn = 10*pi
r(s) = [4*cos(s/5), 4*sin(s/5), 3*s/5] |dr/ds| = 1
curvature = 4/25 torsion = 3/25
For a helix the same computation gives and , both constant. Note is less than the of the circle it winds around: the climb straightens it out.
Constant-speed motion along a spline
Spline parameters are not distances. A cubic Bézier curve evaluated at evenly spaced gives points bunched where the curve is slow. The fix is to tabulate numerically and invert it:
import numpy as np
P = np.array([[0, 0], [1, 3], [5, 3], [6, 0]], dtype=float) # control points
def bez(t):
t = np.asarray(t)[:, None]
return (1-t)**3*P[0] + 3*(1-t)**2*t*P[1] + 3*(1-t)*t**2*P[2] + t**3*P[3]
ts = np.linspace(0, 1, 2001)
pts = bez(ts)
seg = np.linalg.norm(np.diff(pts, axis=0), axis=1)
s = np.concatenate([[0], np.cumsum(seg)]) # arc-length table s(t)
print("curve length ≈", round(float(s[-1]), 4))
def gaps(t_values):
q = bez(t_values)
return np.round(np.linalg.norm(np.diff(q, axis=0), axis=1), 3)
print("even t -> step lengths:", gaps(np.linspace(0, 1, 6)))
t_even_s = np.interp(np.linspace(0, s[-1], 6), s, ts) # invert s(t)
print("even s -> step lengths:", gaps(t_even_s))curve length ≈ 8.0303
even t -> step lengths: [1.705 1.525 1.488 1.525 1.705]
even s -> step lengths: [1.591 1.588 1.588 1.588 1.591]
With equal -steps the chord lengths range from 1.488 to 1.705, about 15% apart. After inverting the table each step covers the same arc, , and the chords agree to within 0.003; they are a little shorter than 1.606 because a chord cuts across the bend, most where the curve bends most (the middle).
Clothoids: curvature that grows linearly
Going straight from a road into a circular bend would make jump from 0 to , so the steering wheel would have to snap instantly. Highways and railways use a transition curve whose curvature grows in proportion to distance, , the clothoid (Euler spiral). With heading angle , the curve is
(Fresnel integrals). Building a curve from its curvature and checking it:
import numpy as np
import matplotlib.pyplot as plt
A = 1.0
s = np.linspace(0, 2.5, 5001)
theta = s**2 / (2 * A**2) # heading = integral of kappa
ds = s[1] - s[0]
x = np.concatenate([[0], np.cumsum((np.cos(theta[1:]) + np.cos(theta[:-1])) / 2 * ds)])
y = np.concatenate([[0], np.cumsum((np.sin(theta[1:]) + np.sin(theta[:-1])) / 2 * ds)])
dx, dy = np.gradient(x, s), np.gradient(y, s)
ddx, ddy = np.gradient(dx, s), np.gradient(dy, s)
kappa = np.abs(dx * ddy - dy * ddx) / (dx**2 + dy**2) ** 1.5
for si in [0.5, 1.0, 2.0]:
i = int(round(si / ds))
print(f"s = {si}: measured curvature {kappa[i]:.4f} (target {si / A**2})")
plt.figure(figsize=(6, 4))
plt.plot(x, y, color="crimson"); plt.axis("equal")
plt.title("Clothoid: curvature grows linearly with distance"); plt.xlabel("x"); plt.ylabel("y")s = 0.5: measured curvature 0.5000 (target 0.5)
s = 1.0: measured curvature 1.0000 (target 1.0)
s = 2.0: measured curvature 2.0000 (target 2.0)
The plane formula (the -component of the cross-product formula) recovers the designed curvature.
In software
- Camera rails and follow cams. A camera on a spline is oriented with a moving frame. The Frenet frame ( forward, toward the bend, "up") is the textbook choice, but flips wherever passes through 0 (inflection points) and is undefined on straight parts, so tools often use a rotation-minimising (parallel-transport) frame instead, which follows without twisting.
- Road and track design. Racing games, railway planners and roller-coaster software specify piecewise (straight, clothoid, arc, clothoid, straight) because lateral acceleration is . A linear means a linear ramp of sideways force, which riders and drivers find comfortable.
- Constant-speed animation. Moving an object at a fixed speed along a Catmull-Rom or Bézier path needs the arc-length table above; engines like Unity's Splines package and Unreal's spline components build such lookup tables internally.
- Path planning. Car-like robots cannot follow corners with ; planners produce paths with bounded and continuous curvature (Dubins and clothoid-based paths).
- Geometry processing. Curvature of a sampled curve (discrete from three neighbouring points) is used for corner detection in sketches, fonts and GPS track simplification.
Exercises
Exercise 1: An exact length
Find the length of for .
Answer
.
Solution
Exercise 2: Curvature of a graph
Find the curvature of at and the radius of the osculating circle there.
Answer
; radius .
Solution
Exercise 3: Arc-length parametrisation, and
Reparametrise by arc length from , and find and .
Answer
; , .
Solution
Exercise 4: Where is an ellipse sharpest? (code)
For the ellipse , compute and find its largest and smallest values.
Answer
; maximum 1 at (ends of the long axis), minimum 0.125 at .
Solution
import numpy as np
t = np.linspace(0, 2 * np.pi, 100001)
k = 8 / (16 * np.sin(t)**2 + 4 * np.cos(t)**2) ** 1.5
print("max", round(float(k.max()), 4), "at t =", round(float(t[k.argmax()]), 4))
print("min", round(float(k.min()), 4), "at t =", round(float(t[k.argmin()]), 4))max 1.0 at t = 0.0
min 0.125 at t = 1.5708
Exercise 5: Frenet frame at a point
For , find , , , and at .
Answer
, , , , .
Solution
At the speed is momentarily stationary (), so is perpendicular to and ; .
import sympy as sp
t = sp.symbols("t")
r = sp.Matrix([t, t**2/2, t**3/3])
d1, d2, d3 = [r.diff(t, k).subs(t, 0) for k in (1, 2, 3)]
c = d1.cross(d2)
print("kappa =", c.norm() / d1.norm()**3, " tau =", c.dot(d3) / c.norm()**2)kappa = 1 tau = 2
Test yourself
A curve is parametrised by arc length . What is ?
- It depends on the curve
- 1
- The length of the curve
Which formula gives the curvature of for an arbitrary smooth parametrisation?
Why do roads and railways use clothoids between a straight section and a circular arc?
- They are shorter than arcs
- Their torsion is constant
- Their curvature grows linearly with distance, so the sideways acceleration ramps up smoothly
- They have zero curvature everywhere