How this calculator works
- Step 1Dotaₓbₓ + a_y b_y + a_z b_zA number: |a||b| cos θ.
- Step 2Crossa × bA vector at right angles to both.
- Step 3Angleatan2(|a × b|, a · b)Accurate at any angle.
The dot product of two vectors is a single number. It is largest when they point the same way, zero when they are perpendicular and negative when they point apart.
The cross product is a vector at right angles to both, with a length equal to the area of the parallelogram they span.
Worked example: (1, 2, 3) and (4, 5, 6)
- cos θ
a · b ÷ (|a| |b|)
- a · b1 × 4 + 2 × 5 + 3 × 632
- |a|√(1 + 4 + 9)3.7417
- a × b(2 × 6 − 3 × 5, 3 × 4 − 1 × 6, 1 × 5 − 2 × 4)(−3, 6, −3)
- Angle12.93°
Read the result
- Perpendicular90.00°(3, 0, 0) and (0, 4, 0): dot product 0.
- Parallel0.00°(3, 4, 0) and (6, 8, 0): cross product zero.
A negative dot product means more than 90° apart: (2, −1, 4) and (−3, 5, 2) are 96.10° apart.
The parallelogram spanned by (1, 2, 3) and (4, 5, 6) has area 7.3485.
Assumptions and limits
- 3DUse z = 0 for flat vectors.
- Right-hand ruleFor the cross product direction.
- Zero vectorHas no angle or direction.
- DegreesAngles from 0° to 180°.
Related algebra tools
Vectors and matrices are the language of directions and transformations.
For matrix products, inverses and determinants, use the matrix calculator. The distance calculator finds lengths between points, and the slope calculator handles lines in two dimensions.
Common mistakes
Mistake: Expecting a × b = b × a.
Instead: Swapping reverses the cross product.
Mistake: Treating the dot product as a vector.
Instead: It is a single number.
Checking the method
A separate script finds every angle with the law of cosines and each cross product by cofactor expansion, and matches each golden value.
Read how we test our calculators, or browse more maths calculators.