Vector Products Calculator
Type two vectors and this calculator shows a x b with all six determinant terms written out, a . b term by term, the length of the cross product and the angle between the two. The arithmetic runs in exact fractions rather than in decimals, so 0.1, 0.2 dotted with 0.3, 0.4 comes back as 0.11 and not as 0.11000000000000001, and a cross product of fractions stays a cross product of fractions. The angle is read from the exact cross magnitude and the exact dot product together, which keeps every digit for a pair that is nearly parallel. The cross product is offered in three dimensions only, because that is where it exists; the dot product takes any two vectors of the same length, up to twelve components each.
a = (2, -1, 3) b = (1, 4, -2)
a x b = ( (-1)(-2) - (3)(4),
(3)(1) - (2)(-2),
(2)(4) - (-1)(1) )
= (-10, 7, 9)
a . b = 2 - 4 - 6 = -8
|a x b| = 15.165751
angle = 117.8118 deg
check (a x b) . a = 0 and (a x b) . b = 0, exactly
|a x b|^2 = 230, from |a|^2|b|^2 - (a . b)^2Separate the components with commas or spaces. Whole numbers, decimals and fractions such as 1/3 are all read exactly, and the answer comes back written the way the question was.
a cross b is the vector (-10, 7, 9), perpendicular to both. a dot b is the number -8. The length of a cross b is 15.165751 and the angle between a and b is 117.8118°.
Three cases worth knowing
Each one is computed by the calculator above. Select a heading to load it.
Common questions
- How do you calculate a cross product?
- For a = (a1, a2, a3) and b = (b1, b2, b3), a x b is (a2b3 - a3b2, a3b1 - a1b3, a1b2 - a2b1). This calculator writes those six products out rather than jumping to the answer: for a = (2, -1, 3) and b = (1, 4, -2) it shows (-1)(-2) - (3)(4), then (3)(1) - (2)(-2), then (2)(4) - (-1)(1), which gives (-10, 7, 9).
- What is the difference between the dot product and the cross product?
- The dot product is a single number and the cross product is a vector, and the results are labelled scalar and vector for exactly that reason. a . b measures how much the two point the same way and is zero when they are square to each other. a x b is a third vector at right angles to both, pointing by the right-hand rule, whose length is the area of the parallelogram that a and b span.
- Can you take the cross product of two 2D vectors?
- No. The vector cross product exists only in three dimensions, so this calculator says so rather than returning something that is not a cross product. Give each vector a third component, usually 0, and the answer points along the z axis: (1, 2, 0) crossed with (3, 4, 0) is (0, 0, -2). If two components is genuinely what you have, the dot product and the angle both work at that length, and there is a button on the message to switch.
- Why does swapping the two vectors flip the sign?
- Because the cross product is anticommutative: b x a is the negative of a x b, component for component. (1, 0, 0) crossed with (0, 1, 0) is (0, 0, 1), and the same pair in the other order is (0, 0, -1). The right-hand rule is applied in the order you typed, so the Swap a and b button is the quickest way to see it happen.
- How do you find the angle between two vectors?
- The usual route is acos of a . b divided by the two lengths, and it loses precision when the vectors are nearly parallel, because the cosine of a small angle sits a hair under 1. This calculator takes atan2 of the exact cross magnitude against the exact dot product instead. For (1, 0, 0) and (1, 0.000001, 0) it reports 0.00005729577951 degrees, where acos alone gives 0.00005729832627: wrong from the fifth digit on. Degrees or radians, whichever you pick.
- Does it keep fractions, or turn everything into decimals?
- The answer comes back written the way the question was. Type 1/2, 1/3, 1/6 and cross it with 2, 3, 6 and you get (3/2, -8/3, 5/6). Type decimals and you get the exact decimal, not a rounded one. The lengths and the angle are the figures that cannot always be written exactly, so they come back as decimals and are labelled as decimals on the result.
- What is the check line under the working?
- It is the calculator checking itself in exact arithmetic before it shows you anything. It confirms that a x b dotted with a is 0 and dotted with b is 0, so the result really is perpendicular to both, and that the squared length of a x b equals |a| squared times |b| squared minus (a . b) squared, which is Lagrange's identity. For (2, -1, 3) and (1, 4, -2) that squared length is 230, and its square root, 15.165751, is the magnitude shown. The angle for that pair is 117.8118 degrees.
Exact arithmetic on the components you enter, kept as integers or fractions wherever the inputs are, with every determinant term written out. The cross product is three-dimensional only and follows the right-hand rule in the order you typed, which is why swapping the operands flips every sign. The dot product takes any two vectors of equal length; the magnitude and the angle are decimals and are labelled as such.