Vector Operations Calculator
Compute vector addition, subtraction, magnitude, and unit vectors with full step-by-step solutions. Supports 2D, 3D, and 4D vectors.
Vector A
Vector B
| Operation | Formula | Result type | Use case |
|---|---|---|---|
| Addition A + B | (ax+bx, ay+by, az+bz) | Vector | Displacement, force summation |
| Subtraction A − B | (ax−bx, ay−by, az−bz) | Vector | Relative position, velocity |
| Magnitude |A| | √(x² + y² + z²) | Scalar | Speed, distance, force size |
| Unit Vector  | A / |A| | Vector (length=1) | Direction in physics, normals in 3D |
Vector Operations Explained
Vectors are mathematical objects with both magnitude (size) and direction, unlike scalars which have only magnitude. Vector operations are foundational to linear algebra, calculus, physics, computer graphics, and machine learning.
Row vs Column Vectors — Convention Differences
In UK and European mathematics, vectors are conventionally written as column vectors (vertical), making matrix-vector multiplication Av (matrix on the left). In US computer science and machine learning contexts, row vectors are often used, especially in NumPy where shape (n,) is treated as a 1D row. Always check which convention your textbook or framework uses — mixing them causes silent transposition errors.
Applications by Field
- Physics: Force, velocity, acceleration, electric field — all vectors. Adding forces uses vector addition; magnitude gives the net force size.
- Computer Graphics: 3D positions, normals, light directions are all 3D vectors. Unit vectors (normalized) are essential for lighting calculations.
- Machine Learning: Feature vectors, word embeddings (word2vec), neural network weights — all vectors. Cosine similarity uses the dot product of unit vectors.
- Navigation: GPS displacement vectors, wind correction in aviation, tide vs heading in nautical navigation.
Frequently Asked Questions
Why can't you add vectors of different dimensions?
Vectors must have the same number of components to be added or subtracted — a 2D vector [1,2] and a 3D vector [1,2,3] exist in different spaces and cannot be directly combined. This mirrors physics: you can't add a force in 2D to a force in 3D without first embedding both in the same space. In ML, this is why feature vectors must all have the same dimensionality.
What is the zero vector and why does it matter?
The zero vector (0, 0, 0) is the additive identity — adding it to any vector leaves the vector unchanged. However, the zero vector has no direction, so the unit vector of the zero vector is undefined. In physics, a zero net force vector means an object is in equilibrium.