Compute 3D vector cross product, magnitude, and direction with step-by-step determinant expansion.
Vectors a (blue) and b (violet) span a parallelogram (shaded). Their cross product a×b (indigo) points perpendicular to that plane. The magnitude of a×b equals the parallelogram area.
Axes guide: x and y are diagonal axes, z points upward from the origin.
Color map: blue = a, violet = b, indigo = a x b. Area relation: |a x b|.
The cross product is a binary operation on two three-dimensional vectors that produces a third vector perpendicular to both inputs. Unlike the dot product — which collapses two vectors into a scalar by measuring how parallel they are — the cross product preserves directional information and measures how much the vectors span a plane. The result vector points orthogonally out of that plane, with its direction determined by the right-hand rule.
To apply the right-hand rule: point your fingers along the first vector a, curl them toward the second vector b (taking the short way around), and your extended thumb points in the direction of a × b. Reversing the order — computing b × a — points your thumb in the opposite direction, confirming anti-commutativity:
The component formula is derived by expanding the 3×3 determinant with unit vectors i, j, k in the first row. Given a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃):
A critical edge case occurs when the two vectors are parallel or anti-parallel: the cross product becomes the zero vector. Intuitively, parallel vectors span a line rather than a plane, so there is no well-defined perpendicular direction and no enclosed area. The magnitude formula confirms this directly:
Since , any pair of collinear vectors yields a zero cross product. Detecting this is a useful test for collinearity — two edges in a mesh that share a vertex and produce a zero cross product lie along the same line and define a degenerate triangle.
The cross product appears throughout physics and engineering wherever rotation, perpendicularity, or area must be computed in three dimensions. Its most fundamental physical application is torque: when a force F is applied at position r relative to a pivot:
The magnitude explains why pushing a wrench at its far end (maximizing ) and perpendicular to the handle (maximizing ) produces the greatest rotational effect.
In computer graphics, surface normals are computed via the cross product of two edge vectors of a triangle. Given vertices P₀, P₁, P₂:
This normal is essential for lighting calculations: Phong and Lambertian shading compute surface brightness as the dot product of the normal with the light direction, so an incorrect normal produces inverted or flat-looking surfaces.
Robotics and kinematics rely on cross products to compute angular velocity and rotation axes. When a rigid body rotates, the velocity of any point r on the body is , where is the angular velocity vector pointing along the rotation axis. This relationship drives inverse kinematics solvers, Jacobian matrix construction, and the simulation of articulated robot arms.
For area workflows, half the cross-product magnitude gives triangle area:
The vector gives you two pieces of information at once: orientation in space and effective area. The direction is perpendicular to both inputs and follows the right-hand rule, while the magnitude tells you how strongly the two vectors span a plane.
This formula is practical for diagnostics. If you know both vector lengths and your computed cross-product magnitude is unexpectedly small, your vectors are close to parallel because is small near and . If the magnitude is large, the vectors are closer to perpendicular, which is usually the most stable setup for geometric and engineering calculations.
A frequent mistake is to treat sign changes as numerical noise. Changing the order of vectors reverses direction exactly:
If your result points opposite to expectation, check vector order first before debugging arithmetic. In code, this manifests as accidentally swapping the two edge vectors when computing a surface normal, producing a face that appears lit from the wrong side.
Finally, the determinant expansion is the most reliable hand-calculation method. Arrange the 3×3 matrix with in row 1, components of in row 2, and components of in row 3. Expand along row 1 using cofactor signs (+, −, +). Each 2×2 minor gives one component. This method scales cleanly to symbolic computation and is the basis of every computer algebra system implementation.
Khan Academy: Cross Product
Interactive lessons on cross product geometry and the right-hand rule with practice problems.
OpenStax Calculus Vol. 3 — The Cross Product
Free university-level textbook chapter covering formulas, proofs, and applied examples.
Wolfram Alpha: Cross Product
Symbolic computation engine — enter any vectors and see full step-by-step expansion.
LibreTexts: Cross Product
Open educational resource with worked examples, visualizations, and exercises.
Multiply two numbers and you get a number. Multiply two vectors and you get... another vector, perpendicular to both of them.
That sounds like math inventing rules for its own convenience. But the cross product captures something physically real: the axis of rotation when two directions interact.
Push a wrench to the right. The bolt turns — but in which direction, clockwise or counterclockwise? The answer depends on which way the cross product of "force direction" and "lever arm direction" points. That's torque. The same operation runs through angular momentum, magnetic force, and 3D surface orientation in computer graphics.
The first time this mattered outside a textbook: a 3D renderer with lighting completely backwards. Faces that should have been bright appeared dark; shadowed ones were lit. One swapped vertex order — instead of — had flipped every surface normal inward. Two hours to diagnose. One-character fix. The anti-commutative property is not abstract algebra trivia.
Given two vectors and , the cross product is perpendicular to both. To find which way it points:
Switch the order — compute instead — and your thumb points the opposite direction. Cross products are anti-commutative:
This isn't a quirk. The order encodes direction — it's the whole point. When you tighten a standard bolt (right-hand thread), you're applying a cross product with a specific handedness.
For vectors and , the cross product is computed using the determinant structure:
Expanding this determinant gives:
Let's run a concrete example. Let and :
Sanity check: the result should be perpendicular to both inputs. Verify with dot products — both should be zero. . Confirmed.
The cross product has a clean geometric interpretation. Two vectors form a parallelogram. The area of that parallelogram equals the magnitude of their cross product:
When — the vectors are parallel — , so the cross product is the zero vector. A parallelogram with two parallel sides has zero area. Makes sense.
When — the vectors are perpendicular — , and the cross product has its maximum magnitude. A rectangle (perpendicular sides) maximizes parallelogram area for given side lengths.
Area shortcut: need the area of a triangle with vertices at three 3D points? Find two edge vectors, compute their cross product, take half the magnitude.
The cross product isn't confined to math courses.
Torque is defined as , where is the position vector from the pivot and is the force. Longer lever arm, same force → larger cross product → more torque. The direction of the torque vector (clockwise vs. counterclockwise) comes from the right-hand rule.
With actual numbers: a 0.3 m wrench with 50 N of perpendicular force gives N·m. Grip the same wrench at 30° off-perpendicular and you get N·m — same force, half the rotational effect. The sin factor in the cross product magnitude formula is what handles that. It measures how perpendicular the two vectors actually are.
Surface normals in 3D graphics define which way a polygon's face points — critical for lighting calculations. Given two edges of a triangle, their cross product gives the normal vector. Flip the vertex order and the normal reverses, which changes whether the triangle is visible from the camera or culled as back-facing. Most rendering pipelines treat counter-clockwise vertex winding (from the camera's perspective) as "front-facing" — the cross product is how the GPU makes that determination, per triangle, every frame.
Magnetic force on a moving charge is . The force is perpendicular to both the velocity and the magnetic field — a cross product — which is why charged particles in magnetic fields travel in circles.
The matrix determinant article goes deeper into why the 3×3 determinant structure works — the cross product formula is actually using the same cofactor expansion.
When two vectors are parallel — pointing in the same direction or exactly opposite — their cross product is the zero vector. The parallelogram they span has zero area. In physics: a force applied directly along the lever arm produces no torque. In graphics: two collinear edges produce no usable surface normal, meaning the triangle is degenerate and effectively unrenderable. Encountering a zero cross product is always a signal that the inputs are aligned in a way the operation can't meaningfully act on.
A less-known fact: the cross product only works in 3D and 7D. In any other number of dimensions, it's mathematically impossible to define a multiplication returning a perpendicular vector with the same algebraic properties. 7D cross products exist and satisfy the same identities, but you won't encounter them outside abstract algebra and certain theoretical physics. For everything practical — torque, surface normals, magnetic force — you're in 3D.
In 2D, there's no third dimension for the perpendicular vector to point into. The 2D analog gives a scalar (not a vector) equal to — this is the z-component of the 3D cross product and equals the area of the 2D parallelogram.
Parallel vectors don't span a plane — they define a line. The parallelogram they form has zero area, so the cross product is the zero vector. In graphics, this is a degenerate triangle (all points on one line) with no meaningful normal. In mechanics, parallel force and lever arm means no torque.
Dot product produces a scalar and measures how much two vectors point in the same direction (). Cross product produces a perpendicular vector and measures how much they span a plane (). One uses cosine, the other sine — they're complementary tools.
Sort of. Applying the 3D formula to 2D vectors (with z = 0) gives a result with only a z-component: . This scalar equals the signed area of the 2D parallelogram — positive if counterclockwise, negative if clockwise. It's useful for testing whether a point is to the left or right of a directed line, and for computing polygon areas via the shoelace formula. Many 2D geometry libraries expose this as a "cross product" function that returns a number rather than a vector.
Multiply two matrices with step-by-step solutions. Learn matrix multiplication rules and properties.
Compute eigenvalues of square matrices (2×2, 3×3, or larger) with step-by-step explanations and characteristic polynomial solving.
Convert matrices to Reduced Row Echelon Form with step-by-step row operations. Perfect for linear algebra.