Cross Product
calculator.
Find a × b for two 3D vectors, with its length, the areas and the angle.
- Length |a × b|
- 7.348469
- Triangle area
- 3.674235
- Angle θ
- 12.9332°
a × b is at right angles to both a and b. Its length, 7.348469, is the area of the parallelogram they span, and the angle between a and b is 12.9332°. Swapping the order flips the direction.
The right-hand rule picture
Vector a = (1, 2, 3) and vector b = (4, 5, 6) span the shaded parallelogram. a × b = (−3, 6, −3) points out of that plane, following the right-hand rule. Turning the view moves the picture only; the numbers stay the same.
Components of each vector
| Vector | x | y | z |
|---|---|---|---|
| a | 1 | 2 | 3 |
| b | 4 | 5 | 6 |
| a × b | −3 | 6 | −3 |
| b × a | 3 | −6 | 3 |
b × a has the same length as a × b and points the other way.
Working
- 1Set up the determinant with i, j and k on topa × b =
- 2i componenta₂b₃ − a₃b₂ = 2 × 6 − 3 × 5 = 12 − 15 = −3
- 3j component (note the minus sign)−(a₁b₃ − a₃b₁) = −(1 × 6 − 3 × 4) = −(−6) = 6
- 4k componenta₁b₂ − a₂b₁ = 1 × 5 − 2 × 4 = 5 − 8 = −3
- 5Magnitude|a × b| = √((−3)² + 6² + (−3)²) = √54 = 7.348469
- 6Check: a × b is at right angles to a and to b(a × b) · a = 0 and (a × b) · b = 0
- 7Angle between a and bθ = atan2(|a × b|, a · b) = atan2(7.348469, 32) = 12.9332°
Many pairs at once
Cross product for each pair
| Pair | a × b | Length | Triangle |
|---|---|---|---|
| (−3, 1, −7) × (0, −5, −5) | (−40, −15, 15)Length 45.2769Triangle 22.6385 | 45.2769 | 22.6385 |
| (1/2, 0, 0) × (0, 20, 0) | (0, 0, 10)Length 10Triangle 5 | 10 | 5 |
| (1, 0, 0) × (−1, 1, 0) | (0, 0, 1)Length 1Triangle 0.5 | 1 | 0.5 |
How it's worked out
The cross product takes two vectors in three dimensions and gives a third vector at right angles to both. OpenStax writes it as a determinant with i, j and k, the unit vectors along x, y and z, in the top row. Expanding it gives one 2 by 2 determinant for each part.
The minus sign on the middle part comes from the sign pattern of a determinant, and it is the step most people drop. For (1, 2, 3) and (4, 5, 6) the three parts are (−3, 6, −3).
The length of the result depends on θ, the angle between a and b. It equals the area of the parallelogram that a and b span, so half of it is the area of the triangle with those two sides.
The angle comes from the length and the dot product together, through atan2. A sine on its own cannot tell 45° from 135°, but the sign of the dot product can.
| × | i | j | k |
|---|---|---|---|
| i | 0 | k | −j |
| j | −k | 0 | i |
| k | j | −i | 0 |
Worked examples
Jordan finds the area and normal of a triangle in a 3D model
Jordan has a triangle with corners P(1, 0, 0), Q(0, 1, 0) and R(0, 0, 1), the example OpenStax uses. Two edges from P give the vectors to cross.
The result (1, 1, 1) is the normal to the triangle, the direction a renderer needs for lighting. Its length is 1.7321, so the triangle's area is half that, about 0.866 square units.
Ana works out the torque on a wrench
Ana pushes with 20 N straight along y on a wrench 0.5 m long that lies along x. Torque is the cross product of the lever arm and the force, with the arm first.
The torque is 10 N·m and points along z, the axis the bolt turns about. Swapping the order to F × r would give (0, 0, −10), the same size the other way round.
Kai checks an angle wider than a right angle
For (1, 0, 0) and (−1, 1, 0), a × b = (0, 0, 1) and the sine of the angle is 0.7071. That sine fits both 45° and 135°.
The dot product is −1, which is below 0, so the vectors point more apart than together. The angle is 135°.
Reading your result
The order sets the direction. OpenStax gives b × a = −(a × b). Point your right hand along a and curl your fingers toward b; your thumb points along a × b. Turn the order round and the thumb points the other way.
Zero means parallel. If one vector is a multiple of the other, they span no area, so the cross product is 0. For (1, 2, 3) and (2, 4, 6) the result is (0, 0, 0).
Flat vectors still work. For two vectors in the xy plane, set the third part to 0. With (3, 1, 0) and (1, 2, 0) the result is (0, 0, 5): only the z part is left, and it equals the area of the parallelogram, with a sign that says which way round they turn.
For a volume, add a dot product. The box with edges (−1, −2, 1), (4, 3, 2) and (0, −5, −2) has u · (v × w) = −40, so its volume is 40 cubic units, the value in OpenStax Example 2.41.
Common mistakes
- Dropping the minus on the middle part. The y part is minus the 2 by 2 determinant. Skipping that sign gives a vector that is not at right angles to a or b, which the check catches.
- Mixing up the order. a × b and b × a point opposite ways. For torque the lever arm comes first.
- Finding the angle with the sine alone. Inverse sine only returns angles up to 90°. Look at the dot product to tell an acute angle from an obtuse one.
- Using the full length for a triangle. |a × b| is the parallelogram. The triangle is half of it.
- Mixing units. A lever arm in centimeters with a force in newtons gives N·cm, 100 times the N·m figure.