Skip to main content

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.

Separate with commas or spaces.

|a| = 7.00,   a · b = −11.0,   θ = 112°
|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. A Level questions usually say how accurate to be: follow the question.

How to do it by hand

  1. Magnitude: |a| = √(a₁² + a₂² + a₃²), Pythagoras in two or three dimensions.
  2. Add or subtract vectors component by component; multiplying by a number multiplies every component.
  3. Scalar product: a · b = a₁b₁ + a₂b₂ + a₃b₃, and cos θ = a · b ÷ (|a||b|). If a · b = 0, the vectors are perpendicular.
  4. 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

A Level Maths: magnitudes, unit vectors and position vectors in 2D and 3D; Further Maths: the scalar product, lines and planes, and the vector product.

Practise it: Vectors.

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, TI-84 Plus CE, Casio fx-991EX ClassWiz and Casio fx-991CW ClassWiz, with a worked example to check against:

Common mistakes

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.

More maths tools