A vector calculator
Vectors describe quantities that have both a size and a direction, such as velocity, force or displacement. Use the calculators below to explore how vectors combine in two and three dimensions.
Describing a vector
Imagine moving two metres east and one metre north. Your change in position can be written as (2, 1).
These two numbers are the vector’s components. Each describes how far you move along one axis. Here, positive x means east and positive y means north. Negative values mean west and south.
An arrow from your starting point to your finishing point represents the vector. Its length, called its magnitude, is the straight-line distance between those points. In this example, Pythagoras gives a length of √(2² + 1²), or about 2.24 metres.
Adding and subtracting
To add two vectors, add their corresponding components. For example:
(2, 1) + (−3, 2) = (−1, 3)
The first movement takes you two metres east and one north. The second takes you three west and two north. Together, they leave you one metre west and three north of where you started.
You can also add them visually. Place the start of the second arrow at the tip of the first. The combined vector runs from the original starting point to the final endpoint.
Drag the arrow handles or enter values in the boxes. Try pointing the arrows in the same direction, then in opposite directions.
When they point the same way, their magnitudes add. When they point in opposite directions, they partly or completely cancel. At other angles, the combined magnitude falls between those extremes.
To subtract B from A, reverse B and add it to A. If you draw A and B from the same starting point, A − B is the arrow from B’s tip to A’s tip.
Adding a third dimension
A three-dimensional vector includes a height component. The vector (2, 1, 3) means two units east, one north and three up.
Addition and subtraction work exactly as before, now with three components. The magnitude is found using √(x² + y² + z²).
You can also describe the direction using two angles: one showing the horizontal direction and another showing the elevation above or below the horizontal plane.
Start with both height components set to zero. Then change one and watch the arrow extend out of the horizontal plane.
The cross product
The three-dimensional calculator also includes the cross product, written A × B. This produces a vector perpendicular to both input vectors.
For two non-parallel vectors, there are two possible perpendicular directions. The right-hand rule selects one: curl the fingers of your right hand from A towards B through the smaller angle, and your thumb points in the cross product’s direction. Swapping A and B reverses the result.
Its magnitude equals the area of the parallelogram formed by the two input arrows. With their lengths fixed, this area is largest when the arrows are at right angles and becomes zero when they are parallel.
Try changing the angle between the arrows and watch both the direction and magnitude of the result. Cross products are useful in physics for describing rotation, including the turning effect of a force.
The calculators use x for east, y for north and z for up. Angles are in degrees, and displayed values are rounded to two decimal places.