Vector Calculator
Perform all common vector operations in 2D and 3D: addition, subtraction, dot product, cross product, magnitude, unit vector, and angle between vectors — with full step-by-step working.
Dimensions
Enter Vectors
Vector A
Vector B
Results
|A|
—
|B|
—
A·B
—
Angle
—
Step-by-Step Working
Vector Formulas Reference
| Operation | Formula (3D) | Result Type |
|---|---|---|
| Addition | A+B = (ax+bx, ay+by, az+bz) | Vector |
| Subtraction | A−B = (ax−bx, ay−by, az−bz) | Vector |
| Magnitude | |A| = √(ax²+ay²+az²) | Scalar |
| Unit vector | Â = A/|A| | Vector |
| Dot product | A·B = ax·bx + ay·by + az·bz | Scalar |
| Cross product | A×B = (ay·bz−az·by, az·bx−ax·bz, ax·by−ay·bx) | Vector (3D only) |
| Angle between | θ = arccos(A·B / (|A||B|)) | Angle (degrees) |
| Perpendicular test | A·B = 0 | Boolean |
| Parallel test | |A×B| = 0 (or A = k·B) | Boolean |
Frequently Asked Questions
The dot product (A·B) produces a scalar — a single number. It equals |A||B|cos(θ) and measures how much one vector projects onto another. The cross product (A×B) produces a new vector perpendicular to both A and B. Its magnitude equals |A||B|sin(θ), equal to the area of the parallelogram formed by the vectors. Cross products only exist in 3D.
Two vectors are perpendicular (orthogonal) when their dot product equals zero: A·B = 0. This is because A·B = |A||B|cos(θ), and cos(90°) = 0. Example: A = (3, 4) and B = (−4, 3) → A·B = 3×(−4) + 4×3 = −12 + 12 = 0 ✓.
Use the dot product formula: θ = arccos(A·B / (|A| × |B|)). This always gives the angle between 0° and 180°. Steps: 1) Calculate A·B. 2) Calculate |A| and |B|. 3) Divide: (A·B) / (|A||B|). 4) Take the inverse cosine.
A unit vector has magnitude 1 and represents pure direction without scale. To find it: divide every component by the original magnitude. Unit vectors are used in physics to represent directions (force direction, velocity direction), in graphics for surface normals, and in maths to separate the "direction" from the "magnitude" of a vector.