Mathematics · Trigonometry · Vectors
Cross Product Calculator
Computes the cross product of two 3D vectors, returning the resulting perpendicular vector and its magnitude.
Calculator
Formula
A⃗ and B⃗ are three-dimensional vectors with components (Ax, Ay, Az) and (Bx, By, Bz) respectively. The resulting vector C⃗ = A⃗ × B⃗ has components Cx = AyBz − AzBy, Cy = AzBx − AxBz, Cz = AxBy − AyBx. The magnitude is |C⃗| = sqrt(Cx² + Cy² + Cz²). The result is always perpendicular to both input vectors.
Source: Kreyszig, E. — Advanced Engineering Mathematics, 10th ed., Wiley (2011), Chapter 9.
How it works
The cross product is a binary operation defined exclusively in three-dimensional (and seven-dimensional) Euclidean space. Unlike the dot product, which yields a scalar, the cross product of two vectors A⃗ and B⃗ produces a third vector C⃗ that is simultaneously perpendicular to both A⃗ and B⃗. The direction of C⃗ is determined by the right-hand rule: if you curl the fingers of your right hand from A⃗ toward B⃗, your extended thumb points in the direction of C⃗. This anti-commutativity property means A⃗ × B⃗ = −(B⃗ × A⃗).
The formula is derived from the determinant of a 3×3 matrix whose first row contains the unit vectors î, ĵ, k̂ and whose second and third rows contain the components of A⃗ and B⃗ respectively. Expanding this determinant gives the three component formulas: Cx = AyBz − AzBy, Cy = AzBx − AxBz, and Cz = AxBy − AyBx. The magnitude of the result equals |A⃗||B⃗|sin(θ), where θ is the angle between the two vectors — this equals the area of the parallelogram spanned by the two vectors. When the two vectors are parallel (θ = 0° or 180°), the cross product is the zero vector.
Practical applications are wide-ranging. In mechanics, torque is τ⃗ = r⃗ × F⃗, where r⃗ is the position vector from the pivot and F⃗ is the applied force. In electromagnetism, the magnetic force on a moving charge is F⃗ = q(v⃗ × B⃗). In 3D computer graphics, cross products generate surface normal vectors for lighting calculations and backface culling. In robotics and aeronautics, angular velocity and moment calculations depend on the cross product. Structural engineers use it to compute moments about an axis and to determine the orientation of load components.
Worked example
Consider two vectors A⃗ = (3, −3, 1) and B⃗ = (4, 9, 2).
Step 1 — Compute Cx: Cx = AyBz − AzBy = (−3)(2) − (1)(9) = −6 − 9 = −15
Step 2 — Compute Cy: Cy = AzBx − AxBz = (1)(4) − (3)(2) = 4 − 6 = −2
Step 3 — Compute Cz: Cz = AxBy − AyBx = (3)(9) − (−3)(4) = 27 + 12 = 39
Result: C⃗ = A⃗ × B⃗ = (−15, −2, 39)
Step 4 — Compute the magnitude: |C⃗| = √((-15)² + (−2)² + 39²) = √(225 + 4 + 1521) = √1750 ≈ 41.833
Step 5 — Verify perpendicularity: A⃗ · C⃗ = (3)(−15) + (−3)(−2) + (1)(39) = −45 + 6 + 39 = 0 ✓
The dot product of A⃗ with the result equals zero, confirming C⃗ is orthogonal to A⃗. The same check with B⃗ would also yield zero.
Limitations & notes
The cross product is only defined in three-dimensional space (with a special analogue in 7D), making this calculator inapplicable to 2D vectors or higher-dimensional spaces beyond 3D. If your vectors are 2D, the cross product can still be computed by appending a z-component of zero; the result will always point along the z-axis with magnitude equal to the 2D scalar cross product |AxBy − AyBx|. Numerical precision can degrade when vectors are nearly parallel — the resulting vector will have a near-zero magnitude, and any tiny floating-point errors can dominate the direction of the result. For unit vectors representing orientations in 3D graphics or robotics, normalise the cross product result if direction alone is needed. Also note that cross products are not associative: A⃗ × (B⃗ × C⃗) ≠ (A⃗ × B⃗) × C⃗ in general.
Frequently asked questions
What does the cross product physically represent?
The cross product A⃗ × B⃗ produces a vector perpendicular to both A⃗ and B⃗, with a magnitude equal to the area of the parallelogram formed by the two vectors. In physics, it represents quantities like torque, angular momentum, and magnetic force — situations where a rotational or perpendicular relationship between two vector quantities is important.
How is the cross product different from the dot product?
The dot product yields a scalar and measures how much two vectors point in the same direction (projection). The cross product yields a vector perpendicular to both inputs and measures how much they point in different directions. The dot product is A⃗ · B⃗ = |A⃗||B⃗|cos(θ), while the cross product magnitude is |A⃗ × B⃗| = |A⃗||B⃗|sin(θ).
What happens when the cross product equals the zero vector?
A zero cross product means the two vectors are parallel or anti-parallel — either both pointing the same direction (θ = 0°) or in opposite directions (θ = 180°). In either case sin(θ) = 0, so the magnitude is zero. This also occurs when either input vector is the zero vector itself.
Can I use this calculator for 2D vectors?
Yes — simply set the z-component of both vectors to zero. The result will have Cx = 0, Cy = 0, and Cz = AxBy − AyBx, which is the scalar 2D cross product (sometimes called the 'z-component cross product'). Its absolute value gives the area of the parallelogram formed by the two 2D vectors.
How do I find the angle between two vectors using the cross product?
Use the relationship |A⃗ × B⃗| = |A⃗||B⃗|sin(θ), so θ = arcsin(|A⃗ × B⃗| / (|A⃗| |B⃗|)). However, since arcsin returns values between −90° and 90°, it is more reliable to compute the angle using the dot product: θ = arccos((A⃗ · B⃗) / (|A⃗| |B⃗|)), which unambiguously gives angles from 0° to 180°.
Last updated: 2025-01-15 · Formula verified against primary sources.