Chapter 15
20 min read
Section 137 of 353

The Cross Product

Vectors and the Geometry of Space

Learning Objectives

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

  1. Define and compute the cross product of two vectors using both the determinant formula and component-by-component calculation
  2. Apply the right-hand rule to determine the direction of the cross product
  3. Interpret geometrically the cross product as a vector perpendicular to both inputs with magnitude equal to the parallelogram area
  4. Prove and use the key properties: anti-commutativity, distributivity, and orthogonality
  5. Apply the cross product to compute torque, angular momentum, and surface normals
  6. Connect the cross product to computer graphics, robotics, and machine learning applications

The Big Picture: A New Way to Multiply Vectors

"The cross product is the tool that lets us construct a vector perpendicular to a plane, find the area of a parallelogram, and calculate rotational effects in physics."

In the previous section, we learned about the dot product ab\mathbf{a} \cdot \mathbf{b}, which takes two vectors and returns a scalar (a number). The dot product measures how much two vectors point in the same direction.

Now we introduce the cross product a×b\mathbf{a} \times \mathbf{b}, which takes two vectors and returns a vector. This new vector is:

  • Perpendicular to both input vectors
  • Has magnitude equal to the area of the parallelogram formed by the two vectors
  • Direction determined by the right-hand rule

Dot Product (Review)

ab=abcosθ\mathbf{a} \cdot \mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos\theta

Returns a scalar. Measures alignment. Maximum when vectors are parallel.

Cross Product (This Section)

a×b=absinθ|\mathbf{a} \times \mathbf{b}| = |\mathbf{a}||\mathbf{b}|\sin\theta

Returns a vector. Measures "perpendicularity." Maximum when vectors are perpendicular.

Key Distinction

The cross product is only defined for vectors in three dimensions. While the dot product generalizes to any number of dimensions, the cross product specifically requires 3D space because its result needs a unique perpendicular direction.


Historical Context: The Birth of Vector Algebra

The cross product emerged from the work of William Rowan Hamilton and Josiah Willard Gibbs in the 19th century. Hamilton developed quaternions in 1843, a four-dimensional extension of complex numbers. The cross product is actually the "vector part" of quaternion multiplication.

Gibbs, an American physicist at Yale, recognized that for most practical applications in physics and engineering, the full machinery of quaternions was unnecessary. In the 1880s, he developed the modern vector notation we use today, extracting the dot product and cross product as separate operations.

The symbol ×\times for the cross product was introduced by Gibbs, deliberately chosen to suggest multiplication while being distinct from the dot product symbol \cdot.

Alternative Names

The cross product is also called the vector product (because it produces a vector), the outer product in some contexts, or simply the cross. In physics, the notation ab\mathbf{a} \wedge \mathbf{b} (wedge product) is sometimes used.


Geometric Definition

The cross product a×b\mathbf{a} \times \mathbf{b} is defined geometrically by two properties:

Geometric Definition of the Cross Product

1. Magnitude

a×b=absinθ|\mathbf{a} \times \mathbf{b}| = |\mathbf{a}||\mathbf{b}|\sin\theta

where θ\theta is the angle between the vectors (0θπ0 \leq \theta \leq \pi)

2. Direction

The vector a×b\mathbf{a} \times \mathbf{b} is perpendicular to both a\mathbf{a} and b\mathbf{b}, with direction given by the right-hand rule.

The Parallelogram Interpretation

The magnitude a×b=absinθ|\mathbf{a} \times \mathbf{b}| = |\mathbf{a}||\mathbf{b}|\sin\theta has a beautiful geometric meaning: it equals the area of the parallelogram formed by vectors a\mathbf{a} and b\mathbf{b}.

Why? Consider a parallelogram with sides a\mathbf{a} and b\mathbf{b}:

  • The base has length a|\mathbf{a}|
  • The height is bsinθ|\mathbf{b}|\sin\theta (the perpendicular distance from base to opposite side)
  • Area = base × height = absinθ=a×b|\mathbf{a}| \cdot |\mathbf{b}|\sin\theta = |\mathbf{a} \times \mathbf{b}|

Triangle Area

The area of a triangle with vertices at the origin and tips of vectors a\mathbf{a} and b\mathbf{b} is half the parallelogram area:

Area=12a×b\text{Area}_{\triangle} = \frac{1}{2}|\mathbf{a} \times \mathbf{b}|


Algebraic Definition: The Determinant Formula

For vectors a=(a1,a2,a3)\mathbf{a} = (a_1, a_2, a_3) and b=(b1,b2,b3)\mathbf{b} = (b_1, b_2, b_3), the cross product can be computed using a determinant:

Determinant Formula

a×b=ijka1a2a3b1b2b3\mathbf{a} \times \mathbf{b} = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix}

Expanding this determinant using cofactors along the first row:

a×b=ia2a3b2b3ja1a3b1b3+ka1a2b1b2\mathbf{a} \times \mathbf{b} = \mathbf{i}\begin{vmatrix} a_2 & a_3 \\ b_2 & b_3 \end{vmatrix} - \mathbf{j}\begin{vmatrix} a_1 & a_3 \\ b_1 & b_3 \end{vmatrix} + \mathbf{k}\begin{vmatrix} a_1 & a_2 \\ b_1 & b_2 \end{vmatrix}

=i(a2b3a3b2)j(a1b3a3b1)+k(a1b2a2b1)= \mathbf{i}(a_2 b_3 - a_3 b_2) - \mathbf{j}(a_1 b_3 - a_3 b_1) + \mathbf{k}(a_1 b_2 - a_2 b_1)

=(a2b3a3b2,a3b1a1b3,a1b2a2b1)= (a_2 b_3 - a_3 b_2, a_3 b_1 - a_1 b_3, a_1 b_2 - a_2 b_1)

Component Formula

In component form, if a=(a1,a2,a3)\mathbf{a} = (a_1, a_2, a_3) and b=(b1,b2,b3)\mathbf{b} = (b_1, b_2, b_3), then:

a×b=(a2b3a3b2,a3b1a1b3,a1b2a2b1)\mathbf{a} \times \mathbf{b} = (a_2 b_3 - a_3 b_2,\, a_3 b_1 - a_1 b_3,\, a_1 b_2 - a_2 b_1)

Memory Aid

Each component is a "cyclic" pattern: for the first component, skip the first index and compute a2b3a3b2a_2 b_3 - a_3 b_2. For the second, skip the second index: a3b1a1b3a_3 b_1 - a_1 b_3. For the third: a1b2a2b1a_1 b_2 - a_2 b_1.

Standard Basis Cross Products

The cross products of the standard basis vectors i,j,k\mathbf{i}, \mathbf{j}, \mathbf{k} follow a cyclic pattern:

Cross ProductResultExplanation
i × jkx-axis crossed with y-axis gives z-axis
j × kiy-axis crossed with z-axis gives x-axis
k × ijz-axis crossed with x-axis gives y-axis
j × i-kReversing order negates the result
k × j-iAnti-commutativity
i × k-jAnti-commutativity
i × i0Any vector crossed with itself is zero

The Cyclic Pattern: ijki\mathbf{i} \to \mathbf{j} \to \mathbf{k} \to \mathbf{i}

Going forward in the cycle gives positive results; going backward gives negative.


The Right-Hand Rule

The right-hand rule is a physical mnemonic for determining the direction of the cross product. Here's how it works:

  1. Point your fingers in the direction of the first vector a\mathbf{a}
  2. Curl your fingers toward the second vector b\mathbf{b} (through the smaller angle)
  3. Your thumb points in the direction of a×b\mathbf{a} \times \mathbf{b}

Right-Hand Rule Visualizer

i × j = k

x-axis crossed with y-axis gives z-axis

a

(1, 0, 0)

b

(0, 1, 0)

a × b

(0, 0, 1)

How to Use the Right-Hand Rule:

  1. 1. Point your fingers in the direction of vector a
  2. 2. Curl your fingers toward vector b (through the smaller angle)
  3. 3. Your thumb points in the direction of a × b

Why "Right-Hand"?

Mathematics uses a right-handed coordinate system by convention: if you point your fingers from the positive x-axis toward the positive y-axis and curl them, your thumb points in the positive z-direction. This convention is standard in physics, engineering, and computer graphics.


Interactive Exploration

Use the visualizer below to explore the cross product. Adjust the vectors a\mathbf{a} and b\mathbf{b} using the sliders and observe how the cross product changes in both magnitude and direction.

Interactive Cross Product Visualizer

Vector a = (2.0, 0.0, 0.0)

Vector b = (1.0, 2.0, 0.0)

Cross Product Result

a × b =
(0.00, 0.00, 4.00)
|a × b| =
4.000
|a| =
2.000
|b| =
2.236
Angle =
63.4°
|a||b|sin(θ) =
4.000

Orange: Vector a | Cyan: Vector b | Purple: a × b | Shaded area: Parallelogram (area = |a × b|)

Notice how:

  • When vectors are perpendicular (θ=90°\theta = 90°), the cross product magnitude is maximized
  • When vectors are parallel (θ=0°\theta = 0° or 180°180°), the cross product is zero
  • The cross product vector is always perpendicular to both input vectors
  • The shaded parallelogram area equals a×b|\mathbf{a} \times \mathbf{b}|

Properties of the Cross Product

The cross product satisfies several important algebraic properties:

1. Anti-Commutativity

b×a=(a×b)\mathbf{b} \times \mathbf{a} = -(\mathbf{a} \times \mathbf{b})

Unlike the dot product (which is commutative), switching the order of the cross product reverses the direction. This is because the right-hand rule gives the opposite direction when you swap the vectors.

2. Distributivity

a×(b+c)=a×b+a×c\mathbf{a} \times (\mathbf{b} + \mathbf{c}) = \mathbf{a} \times \mathbf{b} + \mathbf{a} \times \mathbf{c}

The cross product distributes over addition, just like ordinary multiplication.

3. Scalar Multiplication

(ka)×b=k(a×b)=a×(kb)(k\mathbf{a}) \times \mathbf{b} = k(\mathbf{a} \times \mathbf{b}) = \mathbf{a} \times (k\mathbf{b})

Scalars can be factored out of the cross product.

4. Self Cross Product

a×a=0\mathbf{a} \times \mathbf{a} = \mathbf{0}

Any vector crossed with itself gives the zero vector. This follows from the formula: a×a=aasin(0°)=0|\mathbf{a} \times \mathbf{a}| = |\mathbf{a}||\mathbf{a}|\sin(0°) = 0.

5. Orthogonality

(a×b)a=0and(a×b)b=0(\mathbf{a} \times \mathbf{b}) \cdot \mathbf{a} = 0 \quad \text{and} \quad (\mathbf{a} \times \mathbf{b}) \cdot \mathbf{b} = 0

The cross product is perpendicular to both input vectors, confirmed by zero dot products.

6. NOT Associative

Important Caveat

The cross product is NOT associative:

(a×b)×ca×(b×c)(\mathbf{a} \times \mathbf{b}) \times \mathbf{c} \neq \mathbf{a} \times (\mathbf{b} \times \mathbf{c})

In general, the order of operations matters! There is no simple grouping rule.

Summary of Properties

PropertyFormula
Anti-commutativityb × a = -(a × b)
Distributivitya × (b + c) = a × b + a × c
Scalar multiplication(ka) × b = k(a × b)
Self cross producta × a = 0
Orthogonality(a × b) · a = (a × b) · b = 0
Magnitude|a × b| = |a||b|sin(θ)
Not associative(a × b) × c ≠ a × (b × c) in general

Worked Examples

Example 1: Computing a Cross Product

Find a×b\mathbf{a} \times \mathbf{b} where a=(2,1,1)\mathbf{a} = (2, 1, -1) and b=(1,3,2)\mathbf{b} = (1, 3, 2).

Solution: Using the component formula:

a×b=(a2b3a3b2,a3b1a1b3,a1b2a2b1)\mathbf{a} \times \mathbf{b} = (a_2 b_3 - a_3 b_2,\, a_3 b_1 - a_1 b_3,\, a_1 b_2 - a_2 b_1)

First component: (1)(2)(1)(3)=2+3=5(1)(2) - (-1)(3) = 2 + 3 = 5

Second component: (1)(1)(2)(2)=14=5(-1)(1) - (2)(2) = -1 - 4 = -5

Third component: (2)(3)(1)(1)=61=5(2)(3) - (1)(1) = 6 - 1 = 5

a×b=(5,5,5)\mathbf{a} \times \mathbf{b} = (5, -5, 5)

Verification: Check orthogonality by computing dot products:

(a×b)a=5(2)+(5)(1)+5(1)=1055=0(\mathbf{a} \times \mathbf{b}) \cdot \mathbf{a} = 5(2) + (-5)(1) + 5(-1) = 10 - 5 - 5 = 0

(a×b)b=5(1)+(5)(3)+5(2)=515+10=0(\mathbf{a} \times \mathbf{b}) \cdot \mathbf{b} = 5(1) + (-5)(3) + 5(2) = 5 - 15 + 10 = 0

Example 2: Area of a Triangle

Find the area of the triangle with vertices P=(1,0,0)P = (1, 0, 0), Q=(0,2,0)Q = (0, 2, 0), and R=(0,0,3)R = (0, 0, 3).

Solution: Create edge vectors from P:

PQ=QP=(1,2,0)\overrightarrow{PQ} = Q - P = (-1, 2, 0)

PR=RP=(1,0,3)\overrightarrow{PR} = R - P = (-1, 0, 3)

Cross product:

PQ×PR=((2)(3)(0)(0),(0)(1)(1)(3),(1)(0)(2)(1))\overrightarrow{PQ} \times \overrightarrow{PR} = ((2)(3) - (0)(0),\, (0)(-1) - (-1)(3),\, (-1)(0) - (2)(-1))

=(6,3,2)= (6, 3, 2)

Magnitude:

PQ×PR=62+32+22=36+9+4=49=7|\overrightarrow{PQ} \times \overrightarrow{PR}| = \sqrt{6^2 + 3^2 + 2^2} = \sqrt{36 + 9 + 4} = \sqrt{49} = 7

Area of triangle =127=72=3.5= \frac{1}{2} \cdot 7 = \frac{7}{2} = 3.5

Example 3: Finding a Perpendicular Vector

Find a vector perpendicular to both u=(1,1,0)\mathbf{u} = (1, 1, 0) and v=(1,0,1)\mathbf{v} = (1, 0, 1).

Solution: The cross product gives us exactly this:

u×v=((1)(1)(0)(0),(0)(1)(1)(1),(1)(0)(1)(1))\mathbf{u} \times \mathbf{v} = ((1)(1) - (0)(0),\, (0)(1) - (1)(1),\, (1)(0) - (1)(1))

=(1,1,1)= (1, -1, -1)

The vector (1,1,1)(1, -1, -1) is perpendicular to both u\mathbf{u} and v\mathbf{v}. We can verify: (1,1,1)(1,1,0)=11+0=0(1, -1, -1) \cdot (1, 1, 0) = 1 - 1 + 0 = 0 and (1,1,1)(1,0,1)=1+01=0(1, -1, -1) \cdot (1, 0, 1) = 1 + 0 - 1 = 0


Applications in Physics and Engineering

The cross product appears throughout physics wherever rotation, torque, or perpendicularity is involved.

1. Torque (Moment of Force)

Torque measures the rotational effect of a force about a pivot point:

τ=r×F\boldsymbol{\tau} = \mathbf{r} \times \mathbf{F}

where r\mathbf{r} is the position vector from the pivot to the force application point, and F\mathbf{F} is the force vector.

The magnitude τ=rFsinθ|\boldsymbol{\tau}| = |\mathbf{r}||\mathbf{F}|\sin\theta explains why:

  • Longer lever arms (larger r|\mathbf{r}|) produce more torque
  • Perpendicular forces (θ=90°\theta = 90°) are most effective
  • Forces along the lever (θ=0°\theta = 0°) produce no rotation

Torque as a Cross Product: τ = r × F

Position Vector |r| = 2.0 m

Distance from pivot to force application point

Force Magnitude |F| = 1.5 N

Magnitude of applied force

Force Angle θ = 90°

Angle between lever and force direction

Torque Analysis

Formula:|τ| = |r||F|sin(θ)
Calculation:2.0 × 1.5 × 1.000
Result:|τ| = 3.000 N·m

Key Observations:

  • Maximum torque occurs when θ = 90° (force perpendicular to lever)
  • Zero torque when θ = 0° or 180° (force parallel to lever)
  • • Torque direction is perpendicular to both r and F (out of/into the screen in 2D)
  • • This is why we push door handles at the edge, not near the hinges!

2. Angular Momentum

Angular momentum measures rotational motion:

L=r×p=r×(mv)\mathbf{L} = \mathbf{r} \times \mathbf{p} = \mathbf{r} \times (m\mathbf{v})

where p=mv\mathbf{p} = m\mathbf{v} is linear momentum.

Angular momentum is conserved in the absence of external torques, which explains phenomena like a spinning ice skater accelerating when pulling in their arms.

3. Magnetic Force

The force on a charged particle moving through a magnetic field:

F=qv×B\mathbf{F} = q\mathbf{v} \times \mathbf{B}

where qq is charge, v\mathbf{v} is velocity, and B\mathbf{B} is the magnetic field.

This force is always perpendicular to both the velocity and magnetic field, causing charged particles to move in circular or helical paths.


Applications in Computer Graphics and Machine Learning

The cross product is essential in 3D graphics, robotics, and geometric machine learning.

1. Surface Normals for 3D Rendering

In 3D graphics, every surface needs a normal vector for lighting calculations. Given a triangular face with vertices P1,P2,P3P_1, P_2, P_3, the normal is:

n=(P1P2)×(P1P3)\mathbf{n} = (\overrightarrow{P_1 P_2}) \times (\overrightarrow{P_1 P_3})

This is fundamental to:

  • Diffuse lighting: Brightness ∝ nL\mathbf{n} \cdot \mathbf{L} (Lambert's law)
  • Back-face culling: If nv<0\mathbf{n} \cdot \mathbf{v} < 0, the face points away from the camera
  • Collision detection: Determining which side of a surface an object is on

2. Rotation and Orientation in Robotics

Robot kinematics uses cross products extensively:

  • Computing joint velocities from angular velocities: v=ω×r\mathbf{v} = \boldsymbol{\omega} \times \mathbf{r}
  • Constructing rotation axes for inverse kinematics
  • Calculating Jacobian matrices for robot arm control

3. 3D Deep Learning

In geometric deep learning and point cloud processing:

  • PointNet++ and similar networks use cross products to compute local surface features
  • Mesh neural networks require surface normals as input features
  • Physics-informed neural networks for fluid dynamics use curl operations (which involve cross products)

Python Implementation

Computing and Verifying Cross Products

Let's implement the cross product and verify its properties:

Cross Product Implementation
🐍cross_product.py
3Cross Product Function

This function computes the cross product using the component formula derived from the determinant of a 3×3 matrix with unit vectors i, j, k in the first row.

10Component Calculations

Each component follows the pattern: (a×b)ᵢ = aⱼbₖ - aₖbⱼ where (i,j,k) cycle through (1,2,3), (2,3,1), (3,1,2). This is the cofactor expansion of the determinant.

19Perpendicularity Check

The cross product is perpendicular to both input vectors, so the dot product with each should be zero. Small numerical errors may give values like 1e-15 instead of exactly 0.

25Magnitude Verification

The magnitude |a × b| = |a||b|sin(θ) where θ is the angle between vectors. This equals the area of the parallelogram spanned by a and b.

33Anti-Commutativity

Unlike the dot product, the cross product is anti-commutative: b × a = -(a × b). Switching the order reverses the direction.

54 lines without explanation
1import numpy as np
2
3def cross_product(a, b):
4    """
5    Compute the cross product a × b of two 3D vectors.
6
7    The cross product produces a vector perpendicular to both
8    input vectors, with magnitude equal to the parallelogram area.
9    """
10    # Using the determinant formula
11    cx = a[1] * b[2] - a[2] * b[1]
12    cy = a[2] * b[0] - a[0] * b[2]
13    cz = a[0] * b[1] - a[1] * b[0]
14    return np.array([cx, cy, cz])
15
16def verify_cross_product_properties(a, b):
17    """Verify key properties of the cross product."""
18    c = cross_product(a, b)
19
20    # Property 1: Result is perpendicular to both inputs
21    dot_a = np.dot(c, a)
22    dot_b = np.dot(c, b)
23    print(f"(a × b) · a = {dot_a:.10f}  (should be 0)")
24    print(f"(a × b) · b = {dot_b:.10f}  (should be 0)")
25
26    # Property 2: Magnitude equals |a||b|sin(θ)
27    mag_cross = np.linalg.norm(c)
28    mag_a = np.linalg.norm(a)
29    mag_b = np.linalg.norm(b)
30    cos_theta = np.dot(a, b) / (mag_a * mag_b)
31    sin_theta = np.sqrt(1 - cos_theta**2)
32    expected_mag = mag_a * mag_b * sin_theta
33    print(f"|a × b| = {mag_cross:.6f}")
34    print(f"|a||b|sin(θ) = {expected_mag:.6f}")
35
36    # Property 3: Anti-commutativity
37    c_reversed = cross_product(b, a)
38    print(f"b × a = {c_reversed}")
39    print(f"-(a × b) = {-c}")
40    print(f"Are they equal? {np.allclose(c_reversed, -c)}")
41
42    return c
43
44# Example vectors
45a = np.array([1.0, 2.0, 0.0])
46b = np.array([0.0, 1.0, 3.0])
47
48print("Vectors:")
49print(f"a = {a}")
50print(f"b = {b}")
51print()
52
53print("Cross product a × b:")
54c = verify_cross_product_properties(a, b)
55print(f"Result: {c}")
56print()
57
58# Compare with NumPy's built-in
59print("NumPy verification:", np.cross(a, b))

Application: Surface Normals for 3D Graphics

Here's how the cross product computes surface normals for lighting:

Surface Normal Calculation for 3D Graphics
🐍surface_normals.py
3Surface Normal Calculation

The cross product of two edge vectors of a triangle gives a vector perpendicular to the surface. This is fundamental in 3D graphics for lighting and shading.

14Edge Vectors

We create two vectors from the same vertex (p1). The cross product of these edges is perpendicular to the triangle&apos;s plane.

17Cross Product for Normal

The cross product automatically gives us a vector perpendicular to both edges, which is the surface normal. The order matters: edge1 × edge2 gives outward normal if vertices are counterclockwise.

27Lambert&apos;s Cosine Law

Surface brightness depends on the angle between the normal and light direction. This is computed using the dot product: brightness ∝ n · L = cos(θ).

35Diffuse Lighting

The max(0, ...) ensures negative values (light hitting from behind) don&apos;t create negative brightness. This is the foundation of Phong shading in computer graphics.

57 lines without explanation
1import numpy as np
2
3def compute_surface_normal(p1, p2, p3):
4    """
5    Compute the normal vector to a triangle surface.
6
7    In computer graphics, surface normals are essential for:
8    - Lighting calculations (Lambert's cosine law)
9    - Back-face culling (determining visible faces)
10    - Collision detection
11
12    The normal is computed as the cross product of two edge vectors.
13    """
14    # Create edge vectors from the triangle vertices
15    edge1 = p2 - p1  # Vector from p1 to p2
16    edge2 = p3 - p1  # Vector from p1 to p3
17
18    # The cross product gives a vector perpendicular to the surface
19    normal = np.cross(edge1, edge2)
20
21    # Normalize to unit length
22    magnitude = np.linalg.norm(normal)
23    if magnitude > 1e-10:
24        normal = normal / magnitude
25
26    return normal
27
28def compute_lighting(normal, light_direction, intensity=1.0):
29    """
30    Compute diffuse lighting using Lambert's law.
31
32    I = max(0, n · L) × intensity
33
34    where n is the surface normal and L is the light direction.
35    """
36    # Ensure light direction is normalized
37    light_dir = light_direction / np.linalg.norm(light_direction)
38
39    # Diffuse component (Lambert's cosine law)
40    diffuse = max(0, np.dot(normal, light_dir))
41
42    return diffuse * intensity
43
44# Example: Triangle in 3D space
45p1 = np.array([0.0, 0.0, 0.0])
46p2 = np.array([1.0, 0.0, 0.0])
47p3 = np.array([0.0, 1.0, 0.0])
48
49normal = compute_surface_normal(p1, p2, p3)
50print(f"Triangle vertices: {p1}, {p2}, {p3}")
51print(f"Surface normal: {normal}")
52
53# Light coming from above at an angle
54light_dir = np.array([0.5, 0.5, 1.0])
55brightness = compute_lighting(normal, light_dir)
56print(f"Light direction: {light_dir}")
57print(f"Surface brightness: {brightness:.4f}")
58
59# Perpendicular light (maximum brightness)
60light_dir_perpendicular = np.array([0.0, 0.0, 1.0])
61brightness_max = compute_lighting(normal, light_dir_perpendicular)
62print(f"Perpendicular light brightness: {brightness_max:.4f}")

Common Mistakes to Avoid

Mistake 1: Forgetting Anti-Commutativity

Wrong: Assuming a×b=b×a\mathbf{a} \times \mathbf{b} = \mathbf{b} \times \mathbf{a}

Correct: b×a=(a×b)\mathbf{b} \times \mathbf{a} = -(\mathbf{a} \times \mathbf{b})

Order matters! Switching vectors reverses the direction.

Mistake 2: Confusing Cross and Dot Products

Cross product: Returns a vector perpendicular to both inputs

Dot product: Returns a scalar measuring alignment

They are completely different operations with different geometric meanings.

Mistake 3: Trying to Use Cross Product in 2D

The cross product is only defined for 3D vectors. In 2D, you can compute a "scalar cross product" a1b2a2b1a_1 b_2 - a_2 b_1 which gives the signed area, but this is a scalar, not a vector.

Mistake 4: Assuming Associativity

Wrong: (a×b)×c=a×(b×c)(\mathbf{a} \times \mathbf{b}) \times \mathbf{c} = \mathbf{a} \times (\mathbf{b} \times \mathbf{c})

Reality: These are generally different! The cross product is not associative.

Mistake 5: Wrong Component Formula

A common sign error: the second component has a negative pattern in the determinant expansion.

Correct: (a×b)y=a3b1a1b3(\mathbf{a} \times \mathbf{b})_y = a_3 b_1 - a_1 b_3 (not a1b3a3b1a_1 b_3 - a_3 b_1)


Test Your Understanding

Cross Product Quiz

Question 1 of 8Score: 0/0

What is the result of i × j (where i and j are standard basis vectors)?


Summary

The cross product is a fundamental operation in 3D vector algebra that produces a vector perpendicular to two input vectors with magnitude equal to the parallelogram area they span.

Key Formulas

Magnitude

a×b=absinθ|\mathbf{a} \times \mathbf{b}| = |\mathbf{a}||\mathbf{b}|\sin\theta

Component Formula

(a2b3a3b2,a3b1a1b3,a1b2a2b1)(a_2 b_3 - a_3 b_2, a_3 b_1 - a_1 b_3, a_1 b_2 - a_2 b_1)

Key Properties

PropertyFormula/Description
Anti-commutativeb × a = -(a × b)
Distributivea × (b + c) = a × b + a × c
Perpendicular result(a × b) ⊥ a and (a × b) ⊥ b
Self cross = zeroa × a = 0
Parallelogram area|a × b| = area of parallelogram
Right-hand ruleDetermines direction of result

Key Applications

  1. Torque: τ=r×F\boldsymbol{\tau} = \mathbf{r} \times \mathbf{F}
  2. Angular momentum: L=r×p\mathbf{L} = \mathbf{r} \times \mathbf{p}
  3. Magnetic force: F=qv×B\mathbf{F} = q\mathbf{v} \times \mathbf{B}
  4. Surface normals in 3D graphics
  5. Area calculations for triangles and parallelograms
  6. Rotation axes in robotics and physics simulations
The Cross Product in One Sentence:
"The cross product creates a vector perpendicular to two inputs, with magnitude equal to the parallelogram area and direction given by the right-hand rule."
Coming Next: In the next section, we'll explore Lines and Planes in Space, where the cross product helps us find equations of planes and determine distances and angles in 3D geometry.
Loading comments...