Sub topic 2
The cross product and the right-hand rule
Prerequisites and scope
This chapter assumes you can work with vector components, add vectors, and use basic trigonometry (sine and cosine). It covers the vector operation behind every magnetic force formula in this tutorial: the cross product. You will learn to compute it two ways, find its direction with the right-hand rule, and avoid the usual sign mistakes.
Why magnetism needs a new vector operation
You already know one way to multiply vectors, the dot product. It takes two vectors and returns a number (a scalar). Work, for example, is a dot product of force and displacement.
Magnetic force needs something different. A magnetic force on a moving charge is perpendicular to both the velocity v and the field B. Neither a scalar nor a vector along v or B can describe that. The cross product takes two vectors and returns a third vector that is perpendicular to both. That is why the force law is written F = qv × B.
| Property | Dot product | Cross product |
|---|---|---|
| Result | Scalar | Vector |
| Magnitude | AB cos θ | AB sin θ |
| Largest when | Vectors are parallel | Vectors are perpendicular |
| Zero when | Vectors are perpendicular | Vectors are parallel or antiparallel |
| Order matters? | No | Yes (sign flips) |
Definition: magnitude and direction
For two vectors A and C, with angle θ between them (0° to 180°), the cross product A × C has:
- Magnitude: |A × C| = A C sin θ. This equals the area of the parallelogram the two vectors span.
- Direction: perpendicular to the plane containing A and C, with the sense given by the right-hand rule.
Two consequences matter immediately:
- If A and C are parallel (θ = 0°) or antiparallel (θ = 180°), then sin θ = 0 and the cross product is the zero vector. A charge moving along a field line feels no magnetic force.
- If they are perpendicular (θ = 90°), the magnitude is its maximum, AC.
The right-hand rule
The right-hand rule gives the direction of A × C:
- Point the fingers of your right hand along the first vector, A.
- Curl your fingers toward the second vector, C, through the smaller angle between them.
- Your extended thumb points along A × C.
An equivalent version uses three fingers. Point your index finger along A, your middle finger along C, and your thumb gives A × C. Use your right hand every time. A left hand reverses the answer.
For the magnetic force, the first vector is the velocity (times the charge's sign) and the second is the field. For a positive charge, the thumb points along the force. For a negative charge, the force points opposite to the thumb, because q is negative.
Working with components
Unit vectors x̂, ŷ, ẑ point along the x, y, z axes. Their cross products follow the right-hand rule in a cycle:
- x̂ × ŷ = ẑ
- ŷ × ẑ = x̂
- ẑ × x̂ = ŷ
Reversing the order flips the sign. For example, ŷ × x̂ = −ẑ. Any unit vector crossed with itself gives zero.
For general vectors A = (Aₓ, Ay, Az) and C = (Cₓ, Cy, Cz), expanding with those rules gives:
A × C = (Ay Cz − Az Cy, Az Cₓ − Aₓ Cz, Aₓ Cy − Ay Cₓ)
Each component uses the other two indices in cyclic order. The x component uses y then z, the y component uses z then x, and the z component uses x then y. This is the same as the determinant of a 3×3 matrix with the unit vectors in the top row, which some people find easier to remember.
Worked example by hand
Let v = (1, 0, 0) × 10⁶ m/s and B = (0, 0, 0.5) T. Using the formula:
- x component: vy Bz − vz By = 0·0.5 − 0·0 = 0
- y component: vz Bₓ − vₓ Bz = 0·0 − (10⁶)(0.5) = −5 × 10⁵
- z component: vₓ By − vy Bₓ = 0 − 0 = 0
So v × B = (0, −5 × 10⁵, 0). It points along −y. This matches the right-hand rule: fingers along +x, curl toward +z, and the thumb points along −y. (Try it. Fingers along +x curling upward toward +z means the thumb points away from the +y direction.)
Checking the result with NumPy
The same calculation in code, with a proton's charge, shows that the force on a positive charge points along −y:
import numpy as np
q = 1.602176634e-19
v = np.array([1.0e6, 0.0, 0.0]) # velocity along +x, m/s
B = np.array([0.0, 0.0, 0.5]) # field along +z, T
F = q * np.cross(v, B)
print(F) # force points along -y for a positive chargeThe output is approximately [0. -8.01088317e-14 0.] newtons. The magnitude is qvB = (1.602 × 10⁻¹⁹)(10⁶)(0.5) ≈ 8.0 × 10⁻¹⁴ N, and the sign confirms −y.
Algebraic rules and the one that surprises people
| Rule | Statement |
|---|---|
| Anticommutative | **A** × **C** = −(**C** × **A**) |
| Distributive | **A** × (**C** + **D**) = **A** × **C** + **A** × **D** |
| Scalar multiplication | (k**A**) × **C** = k(**A** × **C**) |
| Self cross product | **A** × **A** = **0** |
| Not associative | **A** × (**C** × **D**) ≠ (**A** × **C**) × **D** in general |
Anticommutativity is the rule that matters most for physics. Swapping the order of the vectors reverses the force direction. In F = qv × B, the order is fixed: velocity first, field second. Writing B × v gives the opposite direction and a wrong answer.
Drawing three dimensions on a flat page
Magnetic field problems often have vectors pointing into or out of the page. Two symbols are standard:
- A dot (⊙) means a vector pointing out of the page, toward you. Think of the tip of an arrow coming at you.
- A cross (⊗) means a vector pointing into the page, away from you. Think of the feathers of an arrow leaving.
For a field pointing into the page (⊗), with a positive charge moving to the right, apply the rule: fingers along +x (right), curl toward the field direction (into the page, −z if z points out). The thumb points up the page. The force on a positive charge is upward.
Common errors
- Using the left hand. The result is exactly reversed. Pick one hand and always use it.
- Forgetting the sign of the charge. The right-hand rule gives the direction of v × B. For a negative charge such as an electron, the force is opposite to that direction.
- Swapping the order. B × v is the negative of v × B.
- Using the wrong angle. θ is the angle between the two vectors when placed tail to tail, not the angle either makes with the horizontal. If a problem gives the angle between the velocity and the field lines, use sin of that angle directly.
- Assuming a nonzero result for parallel vectors. If v is along B, the cross product is zero and so is the force.
- Mixing up dot and cross. A cos θ belongs to the dot product. A sin θ belongs to the cross product.
Checking the angle with code
A short check confirms that the magnitude equals AC sin θ and that the result is perpendicular to both inputs. A dot product of zero indicates perpendicularity.
import numpy as np
A = np.array([3.0, 0.0, 0.0])
C = np.array([2.0, 2.0, 0.0])
X = np.cross(A, C)
cos_t = np.dot(A, C) / (np.linalg.norm(A) * np.linalg.norm(C))
theta = np.arccos(cos_t)
print(X) # [0. 0. 6.]
print(np.linalg.norm(X)) # 6.0
print(np.linalg.norm(A) * np.linalg.norm(C) * np.sin(theta)) # 6.0
print(np.dot(X, A), np.dot(X, C)) # 0.0 0.0Here θ = 45°, so AC sin θ = 3 × 2√2 × (√2/2) = 6. The result points along +z, as the right-hand rule predicts for fingers along +x curling toward +y.
Exercise
A proton moves along +y through a magnetic field pointing along +x. Find the direction of the force on it. Then state the direction if the particle is an electron instead.
Show answer
Compute ŷ × x̂ = −ẑ, so the proton's force is along −z. Check with the right-hand rule: fingers along +y, curl toward +x, and the thumb points into the −z direction. An electron has negative charge, so its force is reversed and points along +z.
Exercise
Let A = (2, −1, 3) and C = (4, 0, −2). Compute A × C using components, then verify that the result is perpendicular to A.
Show answer
x: (−1)(−2) − (3)(0) = 2. y: (3)(4) − (2)(−2) = 12 + 4 = 16. z: (2)(0) − (−1)(4) = 4. So A × C = (2, 16, 4). Dot with A: 2·2 + 16·(−1) + 4·3 = 4 − 16 + 12 = 0, so it is perpendicular.
Exercise
A charge moves at 30° to a field of 0.4 T with speed 2 × 10⁶ m/s and charge 1.6 × 10⁻¹⁹ C. What is the magnitude of the magnetic force?
Show answer
F = qvB sin θ = (1.6 × 10⁻¹⁹)(2 × 10⁶)(0.4)(0.5) = 6.4 × 10⁻¹⁴ N.