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.