Chapter 16
22 min read
Section 145 of 353

The TNB Frame

Vector-Valued Functions

Learning Objectives

By the end of this section, you will be able to:

  1. Define and compute the unit tangent vector T\mathbf{T}, principal normal vector N\mathbf{N}, and binormal vector B\mathbf{B} for curves in 3D space
  2. Understand the geometric meaning of curvature (bending) and torsion (twisting)
  3. Apply the Frenet-Serret formulas to analyze how the TNB frame changes along a curve
  4. Decompose acceleration into tangential and normal components using the TNB frame
  5. Connect these concepts to applications in physics, robotics, computer graphics, and machine learning

The Big Picture: A Coordinate System That Moves With You

"Imagine you are a roller coaster car on a twisting track. The TNB frame is your personal coordinate system—always showing you which way is forward, which way the track is turning, and which way is 'up' relative to your current position."

When we study a curve in 3D space, the standard x,y,zx, y, z coordinate system is often not the most natural choice. Consider a particle moving along a spiral: at each point, we care about the direction of motion, whether we are turning left or right, and whether the path is twisting up or down.

The TNB frame (also called the Frenet-Serret frame) provides exactly this. It is an orthonormal basis that travels along with a point on the curve, consisting of three mutually perpendicular unit vectors:

VectorNamePoints In Direction Of
TUnit TangentInstantaneous velocity (forward)
NPrincipal NormalCenter of curvature (where curve is bending)
BBinormalPerpendicular to both T and N (out of turning plane)

Why the TNB Frame Matters

The TNB frame is essential in:

  • Physics: Decomposing acceleration into tangential (changes speed) and normal (changes direction) components
  • Robotics: Path planning for robot arms and autonomous vehicles
  • Computer Graphics: Camera motion along curves, procedural animation, ribbon/tube generation
  • Machine Learning: Manifold learning, understanding data geometry, neural ODE trajectories

Historical Context: The Geometry of Curves

The theory of space curves was developed in the 19th century as mathematicians sought to understand the intrinsic geometry of curves—properties that depend only on the curve itself, not on how it is positioned in space.

  • Jean Frédéric Frenet (1816–1900): French mathematician who independently discovered the formulas relating the derivatives of T, N, and B in 1847
  • Joseph Alfred Serret (1819–1885): French mathematician who published the same formulas in 1851, giving them the combined name "Frenet-Serret formulas"
  • Carl Friedrich Gauss and Bernhard Riemann: Pioneered the study of intrinsic geometry, which later became differential geometry

A remarkable theorem states that two curves with the same curvature function κ(s)\kappa(s) and torsion function τ(s)\tau(s) are congruent—they differ only by a rigid motion (translation and rotation). This means curvature and torsion completely characterize the shape of a curve!


The Unit Tangent Vector T\mathbf{T}

For a smooth curve r(t)\mathbf{r}(t), the unit tangent vector points in the direction of motion along the curve.

Deriving the Tangent Vector

Recall that the derivative r(t)\mathbf{r}'(t) gives the velocity vector—tangent to the curve but with magnitude equal to the speed. To get a unit vector, we normalize:

Unit Tangent Vector

T(t)=r(t)r(t)\mathbf{T}(t) = \frac{\mathbf{r}'(t)}{|\mathbf{r}'(t)|}

The unit tangent points in the direction of increasing parameter tt

Physical Meaning: If a particle's position is given by r(t)\mathbf{r}(t), then:

  • r(t)\mathbf{r}'(t) is the velocity (direction and speed combined)
  • r(t)|\mathbf{r}'(t)| is the speed (how fast the particle is moving)
  • T(t)\mathbf{T}(t) is the direction of motion (pure direction, unit length)

Using Arc Length Parameterization

If the curve is parameterized by arc length ss (so r(s)=1|\mathbf{r}'(s)| = 1 always), then T(s)=r(s)\mathbf{T}(s) = \mathbf{r}'(s) directly—no normalization needed! This simplifies many formulas.


The Principal Unit Normal Vector N\mathbf{N}

The principal unit normal vector points in the direction that T\mathbf{T} is turning. Since T\mathbf{T} has constant length 1, its derivative T\mathbf{T}' must be perpendicular to T\mathbf{T} (just as velocity is perpendicular to position for uniform circular motion).

Geometric Intuition

Imagine driving a car. The tangent vector T\mathbf{T} points straight ahead through the windshield. When you turn the steering wheel, T\mathbf{T} rotates. The direction it rotates toward is N\mathbf{N}—pointing toward the inside of the turn.

Principal Unit Normal Vector

N(t)=T(t)T(t)\mathbf{N}(t) = \frac{\mathbf{T}'(t)}{|\mathbf{T}'(t)|}

N\mathbf{N} points toward the center of curvature—the center of the "best-fitting circle"

Properties of N:

  • NT\mathbf{N} \perp \mathbf{T} (always perpendicular to the tangent)
  • N=1|\mathbf{N}| = 1 (unit length)
  • N\mathbf{N} lies in the osculating plane—the plane that best fits the curve locally
  • N\mathbf{N} points toward the concave side of the curve

When is N Undefined?

If the curve is locally straight (a line segment), then T(t)=0\mathbf{T}'(t) = \mathbf{0} and N\mathbf{N} is undefined. This happens when the curvature is zero—there is no "direction of turning" when you are not turning!


The Binormal Vector B\mathbf{B}

The binormal vector completes the right-handed orthonormal frame. It is perpendicular to both T\mathbf{T} and N\mathbf{N}, pointing "out of" the osculating plane.

Binormal Vector

B(t)=T(t)×N(t)\mathbf{B}(t) = \mathbf{T}(t) \times \mathbf{N}(t)

The cross product ensures B\mathbf{B} is perpendicular to both and has unit length

The Complete TNB Frame:

  • T\mathbf{T}: Forward direction (tangent to curve)
  • N\mathbf{N}: Toward center of curvature (in osculating plane)
  • B\mathbf{B}: Perpendicular to osculating plane
  • Together they form a right-handed orthonormal basis

Any vector can be expressed in the TNB frame. For example, the acceleration of a particle is:

a=dvdttangentialT+κv2normalN\mathbf{a} = \underbrace{\frac{dv}{dt}}_{\text{tangential}} \mathbf{T} + \underbrace{\kappa v^2}_{\text{normal}} \mathbf{N}

where vv is speed and κ\kappa is curvature. Note that there is no component in the B\mathbf{B} direction—acceleration lives entirely in the osculating plane!


Interactive TNB Frame Explorer

Explore how the TNB frame moves along different curves. Watch how the tangent, normal, and binormal vectors change as you trace along a helix, circle, or other curves. Pay attention to how the frame twists in 3D space!

Interactive TNB Frame Explorer

Watch the Tangent (red), Normal (green), and Binormal (blue) vectors move along different curves

r(t) = (cos(t), sin(t), bt) - constant curvature and torsion

Parameter t0.00
Arrow Scale0.5
Pitch (b)0.50

Current Values

Position: (1.00, 0.00, 0.00)
T: (0.00, 1.00, 0.08)
N: (-1.00, 0.00, 0.00)
B: (0.00, -0.08, 1.00)
Curvature κ: 0.9937
T (Tangent) - direction of motion
N (Normal) - toward center of curvature
B (Binormal) - perpendicular to T and N
Osculating circle (radius = 1/κ)

The Frenet-Serret Formulas

The Frenet-Serret formulas describe how the TNB frame changes as we move along the curve. They express the derivatives of T\mathbf{T}, N\mathbf{N}, and B\mathbf{B} in terms of each other, involving two fundamental quantities: curvature κ\kappa and torsion τ\tau.

Frenet-Serret Formulas (Arc Length Parameterization)

dTds=κN\frac{d\mathbf{T}}{ds} = \kappa \mathbf{N}
dNds=κT+τB\frac{d\mathbf{N}}{ds} = -\kappa \mathbf{T} + \tau \mathbf{B}
dBds=τN\frac{d\mathbf{B}}{ds} = -\tau \mathbf{N}

Reading the Formulas:

  1. dT/ds=κNd\mathbf{T}/ds = \kappa \mathbf{N}: The tangent turns toward the normal at a rate equal to the curvature κ\kappa. Higher curvature = sharper turn.
  2. dN/ds=κT+τBd\mathbf{N}/ds = -\kappa \mathbf{T} + \tau \mathbf{B}: The normal has two components: it turns away from T (since T is turning toward N) and rotates toward B at the torsion rate.
  3. dB/ds=τNd\mathbf{B}/ds = -\tau \mathbf{N}: The binormal turns toward the negative normal at the torsion rate. This is the "twist" of the curve out of its plane.

Frenet-Serret Formulas Explained

Step through each formula to understand how the TNB frame evolves

The Tangent Derivative

dT/ds = κN

The Normal Derivative

dN/ds = -κT + τB

The Binormal Derivative

dB/ds = -τN

The Matrix Form

[T' N' B']ᵀ = [0 κ 0; -κ 0 τ; 0 -τ 0] [T N B]ᵀ
Center
T (red) rotates toward N (green) as the point moves along the circle

The Tangent Derivative

The rate of change of the tangent vector equals curvature times the normal vector.

Interpretation: As you move along the curve, the tangent T rotates toward the normal N. The faster the rotation (larger κ), the sharper the curve is bending.
Intuition: Think of driving: your steering wheel turns toward the inside of the curve (toward N), and tighter turns (higher κ) require more steering.

Curvature and Torsion: The DNA of a Curve

Curvature and torsion are the two fundamental quantities that completely describe the shape of a curve in 3D space.

Curvature κ\kappa: Measuring Bending

Curvature measures how fast the curve is deviating from a straight line—how sharply it is bending.

Curvature

κ=dTds=r×rr3\kappa = \left| \frac{d\mathbf{T}}{ds} \right| = \frac{|\mathbf{r}' \times \mathbf{r}''|}{|\mathbf{r}'|^3}

κ0\kappa \geq 0 always. For a circle of radius RR, κ=1/R\kappa = 1/R

Intuition: At each point, there is a unique circle that best approximates the curve—the osculating circle. The curvature is κ=1/R\kappa = 1/R where RR is the radius of this circle. Tighter curves have smaller radii and larger curvatures.

CurveCurvatureInterpretation
Straight lineκ = 0No bending at all
Circle (radius R)κ = 1/RConstant bending
EllipseVariable κMore bending at ends, less at sides
HelixConstant κ < 1/RConstant bending (less than circle)

Torsion τ\tau: Measuring Twisting

Torsion measures how fast the curve is twisting out of its osculating plane—how the plane itself is rotating as we move along the curve.

Torsion

τ=dBdsN=(r×r)rr×r2\tau = -\frac{d\mathbf{B}}{ds} \cdot \mathbf{N} = \frac{(\mathbf{r}' \times \mathbf{r}'') \cdot \mathbf{r}'''}{|\mathbf{r}' \times \mathbf{r}''|^2}

τ\tau can be positive (right-handed twist), negative (left-handed), or zero (plane curve)

Key Facts About Torsion:

  • A curve lies entirely in a plane if and only if τ=0\tau = 0 everywhere
  • Positive torsion: curve twists like a right-handed screw (standard helix)
  • Negative torsion: curve twists like a left-handed screw
  • For the helix r(t)=(acost,asint,bt)\mathbf{r}(t) = (a\cos t, a\sin t, bt), τ=b/(a2+b2)\tau = b/(a^2 + b^2)

Interactive Curvature and Torsion Explorer

Adjust the parameters of different curves and see how curvature and torsion change. Notice how a helix has constant curvature and constant torsion, while other curves have varying values.

Curvature and Torsion Explorer

See how curvature (bending) and torsion (twisting) vary along different curves

Circular Helix

r(t) = (a·cos(t), a·sin(t), b·t)

κ = a/(a² + b²), τ = b/(a² + b²)

Parameter t0.00
Radius (a)1.00
Pitch (b)0.50
Curvature κ
0.8000
Radius of curvature: 1.25
Torsion τ
0.4000
Right-handed twist
Note: Both curvature and torsion are constant! This is the defining property of a helix.
Curvature κ(t)
tκκ = 0.800
Torsion τ(t)
tττ = 0.400

Understanding the Values

Curvature κ:
  • κ = 0: Locally straight (no bending)
  • Small κ: Gentle curves (large radius)
  • Large κ: Sharp turns (small radius)
  • Radius of curvature = 1/κ
Torsion τ:
  • τ = 0: Curve lies in a plane
  • τ > 0: Right-handed (like a right-hand screw)
  • τ < 0: Left-handed twist
  • |τ| large: Rapid twisting

Computing T, N, B, Curvature, and Torsion

Here are the practical formulas for computing the TNB frame and associated quantities from a parameterized curve r(t)\mathbf{r}(t):

QuantityFormula
Unit Tangent TT = r′ / |r′|
Curvature κκ = |r′ × r″| / |r′|³
Principal Normal NN = (T′ / |T′|) or N = B × T
Binormal BB = T × N = (r′ × r″) / |r′ × r″|
Torsion ττ = (r′ × r″) · r‴ / |r′ × r″|²

Arc Length vs. General Parameter

These formulas work for any parameterization. When using arc length parameter ss (so r(s)=1|\mathbf{r}'(s)| = 1), the formulas simplify significantly. The conversion is ds=r(t)dtds = |\mathbf{r}'(t)|\, dt.


Worked Examples

Example: The Circular Helix

Consider the helix r(t)=(cost,sint,t)\mathbf{r}(t) = (\cos t, \sin t, t). This is perhaps the most important example because it has constant curvature and constant torsion.

Step 1: Compute derivatives

r(t)=(sint,cost,1)\mathbf{r}'(t) = (-\sin t, \cos t, 1)
r(t)=(cost,sint,0)\mathbf{r}''(t) = (-\cos t, -\sin t, 0)
r(t)=(sint,cost,0)\mathbf{r}'''(t) = (\sin t, -\cos t, 0)

Step 2: Compute the unit tangent

r(t)=sin2t+cos2t+1=2|\mathbf{r}'(t)| = \sqrt{\sin^2 t + \cos^2 t + 1} = \sqrt{2}
T(t)=12(sint,cost,1)\mathbf{T}(t) = \frac{1}{\sqrt{2}}(-\sin t, \cos t, 1)

Step 3: Compute curvature

r×r=(sint,cost,1)\mathbf{r}' \times \mathbf{r}'' = (\sin t, -\cos t, 1)
r×r=sin2t+cos2t+1=2|\mathbf{r}' \times \mathbf{r}''| = \sqrt{\sin^2 t + \cos^2 t + 1} = \sqrt{2}
κ=2(2)3=222=12\kappa = \frac{\sqrt{2}}{(\sqrt{2})^3} = \frac{\sqrt{2}}{2\sqrt{2}} = \frac{1}{2}

Note: The curvature is constant! This is a defining property of helices.

Step 4: Compute torsion

(r×r)r=(sint)(sint)+(cost)(cost)+0=1(\mathbf{r}' \times \mathbf{r}'') \cdot \mathbf{r}''' = (\sin t)(\sin t) + (-\cos t)(-\cos t) + 0 = 1
τ=1(2)2=12\tau = \frac{1}{(\sqrt{2})^2} = \frac{1}{2}

The torsion is also constant! For this helix, κ=τ=1/2\kappa = \tau = 1/2.

The Helix is Special

The helix is the only curve (up to similarity) with both constant curvature and constant torsion. It is the 3D analog of a circle, which has constant curvature in 2D. This makes helices fundamental in mathematics, physics (DNA, springs, screw threads), and engineering.


Real-World Applications

Physics: Particle Dynamics

In physics, the TNB frame provides the natural decomposition of acceleration:

Acceleration Decomposition

a=dvdtT+κv2N\mathbf{a} = \frac{dv}{dt}\mathbf{T} + \kappa v^2 \mathbf{N}
Tangential component: aT=dv/dta_T = dv/dt (changes speed)
Normal component: aN=κv2a_N = \kappa v^2 (centripetal)

Applications in physics:

  • Roller coasters: Computing the g-forces experienced by riders (normal acceleration divided by g)
  • Planetary orbits: Understanding how gravity provides the centripetal acceleration
  • Particle accelerators: Designing curved paths for charged particles
  • Race car dynamics: Analyzing tire grip requirements on curved tracks

Engineering and Robotics

The TNB frame is essential in:

  • Robot path planning: Ensuring smooth motion along curved trajectories with controlled accelerations
  • CNC machining: Orienting cutting tools correctly along curved surfaces
  • Pipe and cable routing: Ensuring minimum bend radii are respected (maximum curvature constraints)
  • Railroad design: Computing superelevation (banking) on curves based on curvature and design speed

Machine Learning and Computer Graphics

The TNB frame appears in several modern machine learning and graphics contexts:

Computer Graphics: Camera Motion and Ribbons

  • Camera paths: The TNB frame provides a natural "camera up" vector (B or N) for smooth camera motion along curves
  • Ribbon/tube rendering: Generating surfaces that follow curves (hair, cables, blood vessels) requires sweeping a cross-section along the curve using the TNB frame
  • Font design: Analyzing the curvature of letterforms for optical corrections

Machine Learning: Manifold Geometry

  • Manifold learning: When data lies on a curved manifold, curvature affects the local geometry and distance computations
  • Neural ODEs: Trajectories in neural ODE models can be analyzed using differential geometry concepts including curvature
  • Geodesics: Finding shortest paths on curved surfaces generalizes the concept of straight lines, using curvature

Connection to Deep Learning Optimization

When gradient descent follows a trajectory through parameter space, the curvature of the loss landscape affects convergence. High curvature regions (sharp valleys) require smaller learning rates. The Hessian matrix captures this "curvature" in high dimensions, generalizing the scalar curvature κ\kappa we study for curves.


Python Implementation

Computing the TNB Frame

Computing the TNB Frame
🐍tnb_frame.py
3TNB Frame Function

The TNB frame (also called Frenet-Serret frame) is an orthonormal basis that follows a curve through space. It captures the local geometry: T shows direction, N shows which way the curve is turning, and B completes the right-handed system.

28Unit Tangent Vector T

T = r&apos;(t) / ||r&apos;(t)|| points in the instantaneous direction of motion along the curve. It is always tangent to the curve and has unit length. In physics, this is the direction of velocity.

36Computing Curvature

Curvature κ = ||r&apos; × r&apos;&apos;|| / ||r&apos;||³ measures how fast the curve is bending. High curvature means tight turns; zero curvature means the curve is locally straight. For a circle of radius R, κ = 1/R.

40Binormal Vector B

B = (r&apos; × r&apos;&apos;) / ||r&apos; × r&apos;&apos;|| is perpendicular to the osculating plane (the plane that best fits the curve locally). The binormal points &apos;out of&apos; the plane where the curve is bending.

48Principal Normal N

N = B × T points toward the center of curvature. For a car on a track, N points toward the inside of the turn. Together, T and N span the osculating plane.

70Helix Example

The circular helix is a classic example because it has constant curvature and constant torsion. It spirals around the z-axis, combining circular motion in the xy-plane with linear motion along z.

78 lines without explanation
1import numpy as np
2
3def compute_tnb_frame(r, dr, ddr, t):
4    """
5    Compute the TNB (Frenet-Serret) frame at a point on a curve.
6
7    The TNB frame provides a natural coordinate system that
8    moves along with the curve, capturing local geometry.
9
10    Args:
11        r: Position function r(t) -> [x, y, z]
12        dr: First derivative r'(t) -> [dx/dt, dy/dt, dz/dt]
13        ddr: Second derivative r''(t)
14        t: Parameter value
15
16    Returns:
17        T: Unit tangent vector (direction of motion)
18        N: Principal unit normal (toward center of curvature)
19        B: Binormal vector (perpendicular to osculating plane)
20        kappa: Curvature (how fast curve is bending)
21        tau: Torsion (how fast curve is twisting out of plane)
22    """
23    # Evaluate derivatives at parameter t
24    v = dr(t)      # Velocity vector r'(t)
25    a = ddr(t)     # Acceleration vector r''(t)
26
27    # Speed: ||r'(t)||
28    speed = np.linalg.norm(v)
29
30    # Unit Tangent Vector: T = r'(t) / ||r'(t)||
31    T = v / speed
32
33    # For the normal, we need the derivative of T
34    # Using the formula: T' = (r'' - (r'' · T)T) / ||r'||
35    # which points in the direction of N
36
37    # Cross product r' × r'' gives a vector in the binormal direction
38    cross_v_a = np.cross(v, a)
39    cross_norm = np.linalg.norm(cross_v_a)
40
41    # Curvature: κ = ||r' × r''|| / ||r'||³
42    kappa = cross_norm / (speed ** 3)
43
44    # Binormal Vector: B = (r' × r'') / ||r' × r''||
45    if cross_norm > 1e-10:
46        B = cross_v_a / cross_norm
47    else:
48        # Curve is locally straight, binormal undefined
49        B = np.array([0.0, 0.0, 1.0])  # Default
50
51    # Principal Normal: N = B × T
52    N = np.cross(B, T)
53
54    return T, N, B, kappa
55
56# Example: Circular helix r(t) = (cos(t), sin(t), t)
57def helix_r(t):
58    return np.array([np.cos(t), np.sin(t), t])
59
60def helix_dr(t):
61    return np.array([-np.sin(t), np.cos(t), 1.0])
62
63def helix_ddr(t):
64    return np.array([-np.cos(t), -np.sin(t), 0.0])
65
66# Compute TNB frame at t = π/4
67t_val = np.pi / 4
68T, N, B, kappa = compute_tnb_frame(helix_r, helix_dr, helix_ddr, t_val)
69
70print(f"At t = π/4 on the helix r(t) = (cos(t), sin(t), t):")
71print(f"Position: {helix_r(t_val)}")
72print(f"Tangent T: {T}")
73print(f"Normal N: {N}")
74print(f"Binormal B: {B}")
75print(f"Curvature κ: {kappa:.4f}")
76
77# Verify orthonormality
78print(f"\nVerification (should all be 0):")
79print(f"T · N = {np.dot(T, N):.10f}")
80print(f"T · B = {np.dot(T, B):.10f}")
81print(f"N · B = {np.dot(N, B):.10f}")
82print(f"\n||T|| = {np.linalg.norm(T):.6f}")
83print(f"||N|| = {np.linalg.norm(N):.6f}")
84print(f"||B|| = {np.linalg.norm(B):.6f}")

Computing Torsion

Torsion Calculations
🐍torsion.py
3Torsion Function

Torsion τ (tau) measures how fast the osculating plane is rotating as we move along the curve. Think of it as the &apos;twist rate&apos; of the curve out of its local plane.

12The Torsion Formula

τ = (r&apos; × r&apos;&apos;) · r&apos;&apos;&apos; / ||r&apos; × r&apos;&apos;||². This involves the third derivative r&apos;&apos;&apos; (the &apos;jerk&apos;), which captures how the acceleration is changing—needed to detect twisting.

29Parameterized Helix

A helix r(t) = (a·cos(t), a·sin(t), b·t) has radius a and pitch 2πb. The parameter a controls the circle size, b controls how fast it climbs. Both affect curvature and torsion.

40Constant Torsion

The helix is special: it has constant curvature κ = a/(a²+b²) AND constant torsion τ = b/(a²+b²). This makes it the 3D analog of a circle (which has constant curvature in 2D).

49Plane Curves

Any curve that lies entirely in a plane has zero torsion. This makes sense: if there&apos;s no third dimension to twist into, there can&apos;t be any torsion!

53 lines without explanation
1import numpy as np
2
3def compute_torsion(dr, ddr, dddr, t):
4    """
5    Compute the torsion τ of a curve at parameter t.
6
7    Torsion measures how fast the curve is twisting out of its
8    osculating plane. Positive torsion = right-handed twist,
9    negative torsion = left-handed twist.
10
11    Formula: τ = (r' × r'') · r''' / ||r' × r''||²
12    """
13    v = dr(t)       # r'(t)
14    a = ddr(t)      # r''(t)
15    j = dddr(t)     # r'''(t) - the "jerk"
16
17    # Cross product r' × r''
18    cross_v_a = np.cross(v, a)
19    cross_norm_sq = np.dot(cross_v_a, cross_v_a)
20
21    # Torsion formula
22    if cross_norm_sq > 1e-10:
23        tau = np.dot(cross_v_a, j) / cross_norm_sq
24    else:
25        tau = 0.0  # Curve is straight, torsion undefined
26
27    return tau
28
29# Helix with parameter a (radius) and b (pitch)
30def make_helix(a, b):
31    """Create helix r(t) = (a*cos(t), a*sin(t), b*t)"""
32    def r(t): return np.array([a * np.cos(t), a * np.sin(t), b * t])
33    def dr(t): return np.array([-a * np.sin(t), a * np.cos(t), b])
34    def ddr(t): return np.array([-a * np.cos(t), -a * np.sin(t), 0])
35    def dddr(t): return np.array([a * np.sin(t), -a * np.cos(t), 0])
36    return r, dr, ddr, dddr
37
38# Standard helix: a = 1, b = 1
39r, dr, ddr, dddr = make_helix(1.0, 1.0)
40t_val = np.pi / 3
41
42tau = compute_torsion(dr, ddr, dddr, t_val)
43print(f"Helix torsion at t = π/3: τ = {tau:.6f}")
44
45# For a helix, torsion is constant: τ = b / (a² + b²)
46a, b = 1.0, 1.0
47tau_exact = b / (a**2 + b**2)
48print(f"Exact formula: τ = b/(a²+b²) = {tau_exact:.6f}")
49
50# Comparison: plane curve (circle) has zero torsion
51def circle_r(t): return np.array([np.cos(t), np.sin(t), 0])
52def circle_dr(t): return np.array([-np.sin(t), np.cos(t), 0])
53def circle_ddr(t): return np.array([-np.cos(t), -np.sin(t), 0])
54def circle_dddr(t): return np.array([np.sin(t), -np.cos(t), 0])
55
56tau_circle = compute_torsion(circle_dr, circle_ddr, circle_dddr, np.pi/4)
57print(f"\nCircle (plane curve) torsion: τ = {tau_circle:.10f}")
58print("Plane curves always have τ = 0!")

Physics Application: Acceleration Decomposition

Acceleration in the TNB Frame
🐍physics_applications.py
3Acceleration Decomposition

The TNB frame naturally decomposes acceleration into tangential (changes speed) and normal (changes direction) components. This is essential for understanding forces on moving objects.

23Tangential Acceleration

a_T = a · T gives the component of acceleration along the velocity direction. When a_T > 0, the particle is speeding up; when a_T < 0, it&apos;s slowing down.

27Normal Acceleration

a_N = κv² is the centripetal acceleration, always pointing toward the center of curvature. This is why you feel pushed outward on curves—Newton&apos;s third law response to the inward acceleration!

44Circular Motion

For uniform circular motion, a_T = 0 (constant speed) but a_N = v²/R is non-zero. This is the familiar centripetal acceleration formula from physics.

65Centripetal Force

F = ma_N gives the centripetal force required to keep an object on a curved path. For roller coasters, this must be provided by the track (normal force) plus gravity.

70 lines without explanation
1import numpy as np
2
3def compute_acceleration_components(r, dr, ddr, t):
4    """
5    Decompose acceleration into tangential and normal components
6    using the TNB frame.
7
8    In physics, this decomposition is crucial because:
9    - Tangential acceleration changes the SPEED
10    - Normal acceleration changes the DIRECTION
11
12    For a particle moving along a path:
13      a = a_T * T + a_N * N
14
15    where a_T = dv/dt (rate of speed change)
16          a_N = κv² (centripetal acceleration)
17    """
18    v = dr(t)      # Velocity r'(t)
19    a = ddr(t)     # Acceleration r''(t)
20    speed = np.linalg.norm(v)
21
22    # Unit tangent
23    T = v / speed
24
25    # Tangential acceleration: projection of a onto T
26    a_T = np.dot(a, T)
27
28    # Normal acceleration: ||a - a_T * T||
29    a_N = np.linalg.norm(a - a_T * T)
30
31    # Alternative: a_N = κv² where κ = ||v × a|| / ||v||³
32    cross_v_a = np.cross(v, a)
33    kappa = np.linalg.norm(cross_v_a) / (speed ** 3)
34    a_N_alt = kappa * speed ** 2
35
36    return {
37        'speed': speed,
38        'a_tangential': a_T,
39        'a_normal': a_N,
40        'a_N_from_curvature': a_N_alt,
41        'curvature': kappa
42    }
43
44# Example: Car on a circular track
45# Position: r(t) = (R*cos(ωt), R*sin(ωt), 0)
46R = 100.0  # meters (radius)
47omega = 0.1  # rad/s (angular velocity)
48
49def car_r(t):
50    return np.array([R * np.cos(omega * t), R * np.sin(omega * t), 0])
51def car_dr(t):
52    return np.array([-R * omega * np.sin(omega * t), R * omega * np.cos(omega * t), 0])
53def car_ddr(t):
54    return np.array([-R * omega**2 * np.cos(omega * t), -R * omega**2 * np.sin(omega * t), 0])
55
56result = compute_acceleration_components(car_r, car_dr, car_ddr, 0)
57print("Car on circular track (R=100m, ω=0.1 rad/s):")
58print(f"  Speed: {result['speed']:.2f} m/s")
59print(f"  Tangential acceleration: {result['a_tangential']:.4f} m/s²")
60print(f"  Normal (centripetal) acceleration: {result['a_normal']:.4f} m/s²")
61print(f"  Curvature: {result['curvature']:.6f} (1/R = {1/R:.6f})")
62
63# Example: Roller coaster loop (spiraling down)
64def coaster_r(t):
65    return np.array([10 * np.cos(t), 10 * np.sin(t), -2 * t])
66def coaster_dr(t):
67    return np.array([-10 * np.sin(t), 10 * np.cos(t), -2])
68def coaster_ddr(t):
69    return np.array([-10 * np.cos(t), -10 * np.sin(t), 0])
70
71result2 = compute_acceleration_components(coaster_r, coaster_dr, coaster_ddr, np.pi)
72print(f"\nRoller coaster at t=π:")
73print(f"  Speed: {result2['speed']:.2f} m/s")
74print(f"  Normal acceleration: {result2['a_normal']:.2f} m/s²")
75print(f"  Required centripetal force for 70kg person: {70 * result2['a_normal']:.1f} N")

Test Your Understanding

Question 1 of 10Score: 0/0

What does the unit tangent vector T represent geometrically?


Summary

The TNB Frame

VectorDefinitionPhysical Meaning
T (Tangent)r′/|r′|Direction of motion
N (Normal)T′/|T′|Direction curve is turning toward
B (Binormal)T × NPerpendicular to osculating plane

Curvature and Torsion

QuantityFormulaMeasures
Curvature κ|r′ × r″| / |r′|³How fast curve is bending
Torsion τ(r′ × r″) · r‴ / |r′ × r″|²How fast curve is twisting

Frenet-Serret Formulas

dTds=κN\frac{d\mathbf{T}}{ds} = \kappa \mathbf{N}
dNds=κT+τB\frac{d\mathbf{N}}{ds} = -\kappa \mathbf{T} + \tau \mathbf{B}
dBds=τN\frac{d\mathbf{B}}{ds} = -\tau \mathbf{N}

Key Takeaways

  1. The TNB frame is an orthonormal moving coordinate system that travels along a curve, capturing its local geometry
  2. Curvature measures bending (reciprocal of osculating circle radius); torsion measures twisting out of the osculating plane
  3. A curve is uniquely determined (up to rigid motion) by its curvature and torsion functions—they are the curve's "DNA"
  4. Plane curves have zero torsion; helices have constant curvature AND constant torsion
  5. The TNB decomposition of acceleration (aTT+aNNa_T\mathbf{T} + a_N\mathbf{N}) is essential in physics for analyzing forces on moving objects
The Geometry of Motion:
"The TNB frame reveals that every smooth curve carries with it a natural coordinate system—a personal compass that knows which way is forward, which way you are turning, and which way is up."
Coming Next: In the next section, we explore Planetary Motion and Kepler's Laws—seeing how the mathematics of curves in space explains the motion of planets around the Sun, connecting vector calculus to the laws of celestial mechanics.
Loading comments...