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

Examples:

Vector A

Vector B

Results

|A|

|B|

A·B

Angle

A + B
A − B
B − A
Dot product A·B
Cross product A×B
|A| (magnitude of A)
|B| (magnitude of B)
 (unit vector of A)
B̂ (unit vector of B)
Angle θ between A and B
Are A and B perpendicular?
Are A and B parallel?

Step-by-Step Working

Vector Formulas Reference

OperationFormula (3D)Result Type
AdditionA+B = (ax+bx, ay+by, az+bz)Vector
SubtractionA−B = (ax−bx, ay−by, az−bz)Vector
Magnitude|A| = √(ax²+ay²+az²)Scalar
Unit vector = A/|A|Vector
Dot productA·B = ax·bx + ay·by + az·bzScalar
Cross productA×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 testA·B = 0Boolean
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.