What this calculator does
This tool performs vector addition and subtraction component by component. Enter two vectors a and b of the same dimension (2D, 3D, or any number of components) and choose an operation: a + b, a - b, or b - a. The calculator returns the resulting vector c and its magnitude (Euclidean length). This is pure linear algebra and works the same everywhere.
How to use it
Type the components of Vector a and Vector b, separated by commas or spaces (for example 1, 2, 3). Both vectors must have exactly the same number of components. Pick the operation you want, then read off the resulting vector c and its magnitude. Negative and decimal values are fully supported.
The formula explained
For each index k from 1 to i, the result component is computed directly: for a + b, \(c_k = a_k + b_k\); for a - b, \(c_k = a_k - b_k\); and for b - a, \(c_k = b_k - a_k\). Note that a - b is exactly the negation of b - a. The magnitude is the square root of the sum of the squares of all components:
$$|\vec{c}| = \sqrt{c_1^{\,2} + c_2^{\,2} + \dots + c_i^{\,2}}$$
Worked example
Let a = (1, 2, 3) and b = (4, 5, 6). Then
$$a + b = (1+4,\ 2+5,\ 3+6) = (5,\ 7,\ 9)$$with magnitude
$$\sqrt{25 + 49 + 81} = \sqrt{155} \approx 12.4499$$For \(a - b = (-3, -3, -3)\), the magnitude is
$$\sqrt{9 + 9 + 9} = \sqrt{27} \approx 5.1962$$the same as for \(b - a = (3, 3, 3)\).
FAQ
Do the vectors need the same dimension? Yes. Vector addition and subtraction are only defined for vectors of equal length. Mismatched lengths produce an error.
Can I use more than three components? Yes, any positive number of components works as long as both vectors match.
What is the magnitude? It is the length of the resulting vector, computed as the Euclidean norm (square root of the sum of squared components).