Vector calculator
Type the components of a (and b if you want to combine two vectors). You get the magnitude, the unit vector, the sum and difference, the scalar product, the angle between them and, in 3D, the vector product.
- |a|
- 7.00
- |b|
- 4.24
- a · b
- −11.0
- Angle
- 112°
- |a × b|
- 27.6
Show the working
|a| = √(3² + −2² + 6²) = 7.00
Unit vector â = a ÷ |a| = 0.429−0.2860.857
|b| = 4.24
a + b = 4.002.005.00 a − b = 2.00−6.007.00
a · b = (3)(1) + (−2)(4) + (6)(−1) = −11.0
cos θ = a · b ÷ (|a||b|) = −11.0 ÷ (7.00 × 4.24) = −0.370, so θ = 112° (1.95 radians)
a × b = −22.09.0014.0 (perpendicular to both; |a × b| = 27.6 is the area of the parallelogram they make)
Answers are rounded to 3 significant figures, which is what IB papers ask for unless a question says otherwise.
How to do it by hand
- Magnitude: |a| = √(a₁² + a₂² + a₃²), Pythagoras in two or three dimensions.
- Add or subtract vectors component by component; multiplying by a number multiplies every component.
- Scalar product: a · b = a₁b₁ + a₂b₂ + a₃b₃, and cos θ = a · b ÷ (|a||b|). If a · b = 0, the vectors are perpendicular.
- Vector product (3D): a × b is perpendicular to both a and b, and |a × b| is the area of the parallelogram they make.
Worked example
Find the angle between the vectors a = 2i + j − 2k and b = i − 3j + 4k.
Solution
|a| = √(2² + 1² + −2²) = 3.00
Unit vector â = a ÷ |a| = 0.6670.333−0.667
|b| = 5.10
a + b = 3.00−2.002.00 a − b = 1.004.00−6.00
a · b = (2)(1) + (1)(−3) + (−2)(4) = −9.00
cos θ = a · b ÷ (|a||b|) = −9.00 ÷ (3.00 × 5.10) = −0.588, so θ = 126° (2.20 radians)
a × b = −2.00−10.0−7.00 (perpendicular to both; |a × b| = 12.4 is the area of the parallelogram they make)
Answer: |a| = 3.00, a · b = −9.00, θ = 126°
Every number in this example is worked out by the same code as the tool above, and the code is tested against independent results from Python's SciPy library.
Where you need it
| AA SL | Not in the syllabus |
|---|---|
| AA HL | Scalar and vector products, angles, lines and planes. Many vector questions want exact working: use the GDC to check. |
| AI SL | Not in the syllabus |
| AI HL | Scalar and vector products, angles between vectors, and vector kinematics. |
On your calculator
In the exam you use your own calculator, so practise it too. Our guides give the exact keystrokes for the Casio fx-CG50, TI-Nspire CX II and TI-84 Plus CE, with a worked example to check against:
Common mistakes
- Forgetting to square negative components: (−2)² = 4, so they still add to the magnitude.
- Dividing by |a| + |b| instead of |a| × |b| when finding the angle.
- Calculator in radians when the question wants degrees.
- Mixing up a · b (a number) and a × b (a vector).
Notes and practice
Questions students ask
How do I know if two vectors are perpendicular?
Their scalar (dot) product is 0. For parallel vectors, one is a multiple of the other.
What is a unit vector?
A vector of length 1. Divide a vector by its magnitude to get the unit vector in the same direction.
Why can the angle come out obtuse?
If the scalar product is negative, cos θ is negative and the angle between the vectors (placed tail to tail) is more than 90°. The acute angle between two lines is 180° minus it.