dash–calculator

01 Vectors and Coordinates

Cross Product Calculator: Formula & Examples

Readout 01-0208 · Updated · Standard formula, shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

This calculator computes the cross product of two 3D vectors, returning a third vector that is perpendicular to both inputs. You enter the x, y, and z components of each vector, and the calculator gives you the resulting vector’s components, its magnitude, and the sine of the angle between the original vectors. The cross product is a fundamental operation in physics and engineering, used for torque, angular momentum, and finding normal vectors to surfaces.

Formula

The cross product of two vectors A = (ax, ay, az) and B = (bx, by, bz) is defined as:

C = A × B = (aybz − azby, azbx − axbz, axby − aybx)

Each component of the result is a combination of the other two components of the inputs. The magnitude of the cross product is:

|C| = |A||B| sin(θ)

where θ is the angle between the vectors (0° to 180°). The direction of C follows the right-hand rule: if you curl the fingers of your right hand from A toward B, your thumb points along C.

Worked Example

Let’s use the default values: A = (1, 2, 3) and B = (4, 5, 6).

  1. Cx = aybz − azby = 2×6 − 3×5 = 12 − 15 = −3
  2. Cy = azbx − axbz = 3×4 − 1×6 = 12 − 6 = 6
  3. Cz = axby − aybx = 1×5 − 2×4 = 5 − 8 = −3

So A × B = (−3, 6, −3). The magnitude is √(9 + 36 + 9) = √54 ≈ 7.35. The sine of the angle between the vectors is 7.35 / (√14 × √77) ≈ 7.35 / (3.742 × 8.775) ≈ 7.35 / 32.83 ≈ 0.2239, so θ ≈ 12.9°.

When to Use the Cross Product

The cross product appears in any situation involving rotation or perpendicularity in 3D space. Common applications include:

  • Torque: τ = r × F, where r is the lever arm and F is the force.
  • Angular momentum: L = r × p, where p is linear momentum.
  • Finding a normal vector: The cross product of two non-parallel vectors on a plane gives a vector perpendicular to that plane.
  • Area of a parallelogram: The magnitude |A × B| equals the area of the parallelogram spanned by A and B.
  • Magnetic force: F = qv × B (Lorentz force).

If you only need the angle between two vectors, the dot product is simpler and gives a scalar directly. Use the cross product when you need the perpendicular direction itself, not just the angle.

How to Read the Result

The output vector C is perpendicular to both A and B. Its magnitude tells you:

  • If |C| = 0, the vectors are parallel or one is zero (θ = 0° or 180°).
  • If |C| = |A||B|, the vectors are perpendicular (θ = 90°).
  • Otherwise, |C| is between 0 and |A||B|, and sin(θ) = |C| / (|A||B|).

The sine output is useful for quickly checking the angle without computing arccos. The cross product is anti-commutative: A × B = −(B × A). If you swap the inputs, the direction flips, but the magnitude stays the same.

Common Mistakes and Pitfalls

  • Forgetting the minus sign in the middle component: Cy = azbx − axbz, not axbz − azbx. This is the most frequent error.
  • Using 2D vectors: The cross product is only defined in 3D. For 2D vectors, treat the z-component as 0, and the result will have only a z-component (a scalar in 2D).
  • Unit mix-ups: If your vectors have units (e.g., meters and newtons for torque), the cross product’s units are the product of the two input units (N·m). Keep units consistent.
  • Rounding too early: When calculating the magnitude, keep intermediate values with full precision to avoid significant rounding errors.
  • Assuming commutativity: The cross product is not commutative. Always keep the order of the inputs as given.

Cross Product vs. Dot Product

The dot product (A·B) returns a scalar and measures how much two vectors point in the same direction. The cross product returns a vector and measures how much they point in different directions (perpendicular component). Both are related to the angle:

  • A·B = |A||B| cos(θ)
  • |A×B| = |A||B| sin(θ)

Together, they can give you the full angle: tan(θ) = |A×B| / (A·B). In 2D, the cross product’s magnitude is the area of the parallelogram, and its sign indicates the orientation (clockwise vs. counterclockwise).

Limitations of the Formula

The cross product is only defined for three-dimensional vectors. For higher dimensions, a generalization called the exterior product is used, but it produces a bivector, not a simple vector. Also, the cross product is not associative: (A×B)×C ≠ A×(B×C) in general. This means you cannot drop parentheses when computing triple products. The scalar triple product A·(B×C) gives the volume of a parallelepiped and is cyclic: A·(B×C) = B·(C×A) = C·(A×B).

If your vectors have very large or very small components, the intermediate products can overflow or underflow in floating-point arithmetic. This calculator uses double precision, but for extreme values (e.g., 10200), you may see “Infinity” or “Cannot compute”. In such cases, scale your vectors down first.

Frequently Asked Questions

What is the cross product used for in real life?

Engineers use it to calculate torque on a bolt, the force on a current-carrying wire in a magnetic field, and the angular momentum of a spinning object. In computer graphics, it finds the normal vector to a surface for lighting calculations. In robotics, it helps compute the velocity of a point on a rotating arm.

Can I use the cross product for 2D vectors?

Yes, if you set the z-components to zero. The result will be (0, 0, axby − aybx), which is often treated as a scalar. That scalar’s absolute value is the area of the parallelogram formed by the two vectors, and its sign tells you the rotation direction.

Why is the cross product not commutative?

Because the right-hand rule defines a specific orientation. Swapping the order reverses the direction of the resulting vector, so A×B = −(B×A). This anti-commutativity is essential for physical laws like torque, where the direction matters.

What does it mean when the cross product is zero?

It means the two vectors are parallel (or one is the zero vector). The angle between them is 0° or 180°, so sin(θ) = 0. In that case, they do not span a parallelogram with any area, and there is no unique perpendicular direction.

How do I find the angle between two vectors using the cross product?

Compute the magnitude of the cross product and divide by the product of the magnitudes of the original vectors: sin(θ) = |A×B| / (|A||B|). Then take the inverse sine. However, this only gives angles from 0° to 90°; to get the full 0° to 180° range, use the dot product as well: θ = atan2(|A×B|, A·B).

Is the cross product the same as the vector product?

Yes, they are the same thing. The term “cross product” comes from the × symbol used, while “vector product” emphasizes that the result is a vector. Both refer to the operation defined by the formula above.

Related

Formula used
in ax | Vector A x | - | 1 | -1000000 | 1000000
in ay | Vector A y | - | 2 | -1000000 | 1000000
in az | Vector A z | - | 3 | -1000000 | 1000000
in bx | Vector B x | - | 4 | -1000000 | 1000000
in by | Vector B y | - | 5 | -1000000 | 1000000
in bz | Vector B z | - | 6 | -1000000 | 1000000
out cx | Cx (A×B) | - | ay*bz - az*by | 2
out cy | Cy (A×B) | - | az*bx - ax*bz | 2
out cz | Cz (A×B) | - | ax*by - ay*bx | 2
out mag | |C| | - | sqrt(cx^2 + cy^2 + cz^2) | 2
out sin | sin(θ) | - | mag / (sqrt(ax^2+ay^2+az^2) * sqrt(bx^2+by^2+bz^2)) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More on this panel

The whole Vectors and Coordinates panel →