Sub topic 2
A quick tool: the cross product
This chapter assumes you know vector components and the dot product, and that you are comfortable with the idea of a vector having both a magnitude and a direction. The cross product is the operation behind two central quantities in this tutorial: angular momentum, L = r × p, and torque, τ = r × F. You need to compute it quickly and to read its direction correctly.
What the cross product does
The cross product takes two vectors in three dimensions and returns a third vector. The dot product returns a number (a scalar), so the two operations differ in kind.
For vectors a and b, the vector c = a × b has these properties:
- Its magnitude is |c| = |a| |b| sin θ, where θ is the angle between a and b (0° to 180°).
- Its direction is perpendicular to both a and b.
- Which of the two perpendicular directions it takes is set by the right-hand rule.
The magnitude |a| |b| sin θ equals the area of the parallelogram that a and b span. If the vectors are parallel (θ = 0° or 180°), sin θ = 0 and the cross product is the zero vector. If they are perpendicular, the cross product has its largest possible magnitude, |a| |b|.
This sin θ factor is the reason angular momentum and torque depend on only the part of a vector that is perpendicular to the position vector. We will return to that below.
The right-hand rule
Point the fingers of your right hand along a. Curl them toward b through the smaller angle between the two. Your thumb then points along a × b.
For the standard unit vectors, the rule gives a cyclic pattern:
| Product | Result |
|---|---|
| x̂ × ŷ | ẑ |
| ŷ × ẑ | x̂ |
| ẑ × x̂ | ŷ |
| ŷ × x̂ | −ẑ |
| x̂ × x̂ | 0 |
Reading the first three rows in the order x, y, z, x, y, z gives a positive result. Reversing the order gives a negative one.
Computing it from components
For a = (aₓ, ay, az) and b = (bₓ, by, bz):
- (a × b)ₓ = ay bz − az by
- (a × b)y = az bₓ − aₓ b_z
- (a × b)z = aₓ by − a_y bₓ
Each component uses the other two coordinates, in cyclic order. A common memory aid is the determinant of a 3 × 3 matrix whose top row is x̂, ŷ, ẑ, whose middle row is the components of a, and whose bottom row is the components of b.
NumPy implements this as np.cross. The program below checks the three defining properties: magnitude, perpendicularity, and the zero result for parallel vectors.
import numpy as np
a = np.array([3.0, 0.0, 0.0])
b = np.array([2.0, 2.0, 0.0]) # 45 degrees from a
c = np.cross(a, b)
print(c) # [0. 0. 6.]
# Magnitude: |a||b| sin(theta), with theta = 45 degrees
mag_formula = np.linalg.norm(a) * np.linalg.norm(b) * np.sin(np.pi / 4)
print(np.linalg.norm(c), mag_formula) # both are about 6.0
# Perpendicular to both inputs: dot products are zero
print(np.dot(c, a), np.dot(c, b)) # 0.0 0.0
# Parallel vectors give the zero vector
print(np.cross(a, 2 * a)) # [0. 0. 0.]Algebraic rules
These rules matter in later chapters, where we manipulate expressions such as dL/dt = d(r × p)/dt.
- Anticommutative: a × b = −(b × a). Swapping the order flips the direction.
- Distributive: a × (b + c) = a × b + a × c.
- Scalar factors pull out: (ka) × b = k(a × b).
- Product rule for derivatives: d(a × b)/dt = (da/dt) × b + a × (db/dt). The order of the factors must be kept.
- Not associative: (a × b) × c is generally not equal to a × (b × c).
The code below confirms rules 1 and 5 with the unit vectors.
import numpy as np
x = np.array([1.0, 0.0, 0.0])
y = np.array([0.0, 1.0, 0.0])
print(np.cross(x, y), np.cross(y, x)) # [0. 0. 1.] [ 0. 0. -1.]
left = np.cross(np.cross(x, x), y) # (x cross x) cross y = 0
right = np.cross(x, np.cross(x, y)) # x cross (x cross y) = -y
print(left, right) # [0. 0. 0.] [ 0. -1. 0.]The product rule in item 4 is the one you will use most. It is why the derivative of r × p splits into two terms: one with v × p and one with r × F. The first term vanishes because p = mv is parallel to v.
Using the cross product for angular momentum
For a particle with position r (measured from a chosen origin) and momentum p = mv, the angular momentum is L = r × p. Consider a 2 kg particle at r = (2, 0, 0) m moving with v = (0, 1.5, 0) m/s. Then p = (0, 3, 0) kg m/s, and the cross product gives L = (0, 0, 6) kg m²/s. This is the counterclockwise motion about the origin seen from above, with L pointing along +z.
The direction of L does not describe a direction in which anything moves. It is the axis of the rotation, with the sense of rotation given by the right-hand rule: curl your fingers the way the particle circulates, and your thumb gives L.
Torque and the lever arm
Torque uses the same operation with force instead of momentum: τ = r × F. Its magnitude is |τ| = r F sin θ, where θ is the angle between r and F. You can group this factor in two equivalent ways:
- r (F sin θ): the position times the component of the force perpendicular to r.
- (r sin θ) F: the force times the lever arm, the perpendicular distance from the origin to the line along which the force acts.
A force directed along r (θ = 0°) has zero lever arm and produces no torque. A force perpendicular to r is the most effective.
Take a wrench handle at r = (0.5, 0, 0) m with a downward force F = (0, 0, −10) N. The result is τ = (0, 5, 0) N m. The wrench turns about the y-axis, not about the axis along which you push. This is exactly the kind of result that surprises people the first time: the torque is perpendicular to both the arm and the force.
Common errors
- Reversing the order. r × p and p × r differ by a sign. Angular momentum is r × p, with position first.
- Using the wrong angle. In |a| |b| sin θ, θ is the angle between the vectors when placed tail to tail. Using the angle from the horizontal or from some other reference gives wrong magnitudes.
- Assuming the origin does not matter. r is measured from the chosen origin, so L and τ depend on that choice. The next program shows this for a particle moving along a straight line.
- Passing 2D vectors to
np.cross. NumPy 2.0 deprecated this. For planar motion, compute the z-component directly as aₓ by − ay bₓ.
import numpy as np
p = np.array([4.0, 0.0, 0.0]) # moving along +x at y = 1
r = np.array([-3.0, 1.0, 0.0]) # position relative to origin O
print(np.cross(r, p)) # [ 0. 0. -4.]
# Same particle later, farther along its line: L is unchanged
print(np.cross(np.array([5.0, 1.0, 0.0]), p)) # [ 0. 0. -4.]
# Move the origin onto the particle's line: L becomes zero
origin = np.array([0.0, 1.0, 0.0])
print(np.cross(r - origin, p)) # [0. 0. 0.]
# Planar shortcut for the z-component, with no 2D np.cross call
rx, ry = r[0], r[1]
px, py = p[0], p[1]
print(rx * py - ry * px) # -4.0A particle moving in a straight line at constant velocity has an L that stays at −4 kg m²/s about the first origin, even though it never "goes around" anything. About the point on its own line, L is zero. This observation matters when we ask whether angular momentum is conserved, and about which point.
Exercises
Exercise
A particle of mass 0.5 kg is at r = (0, 4, 0) m and has velocity v = (3, 0, 0) m/s. Find its angular momentum about the origin, including direction.
Show answer
p = m v = (1.5, 0, 0) kg m/s. L = r × p has z-component rₓ py − ry pₓ = 0 − (4)(1.5) = −6, and the x and y components are zero. So L = (0, 0, −6) kg m²/s, with magnitude 6 kg m²/s along −z. The particle moves clockwise as seen from above.
Exercise
A force F = (0, 6, 0) N acts at r = (2, 0, 0) m. Compute the torque about the origin. Then find the torque if the same force acts at r = (0, 3, 0) m.
Show answer
For r = (2, 0, 0): τz = rₓ Fy − r_y Fₓ = (2)(6) − 0 = 12, so τ = (0, 0, 12) N m. For r = (0, 3, 0), the force is parallel to r, so sin θ = 0 and τ = (0, 0, 0). The lever arm is zero in that case.