Vector Calculator
Add and subtract vectors, find the magnitude, unit vector, dot product, cross product, angle between two vectors and the projection of one onto another — in 2D or 3D, with the determinant working shown.
Written by Suhaib Hassan. Every formula is standard vector algebra, and the worked examples are re-derived by hand. Our methodology.
It combines components directly: sums of products for the dot product, a 3×3 determinant for the cross product, and arccos of the normalised dot product for the angle.
Physics and graphics use these operations constantly. Seeing the vectors drawn and the algebra written out makes sign and order errors easy to spot.
—
Vector diagram
Vectors drawn from the origin; 3D vectors use an oblique projection.
Step-by-step working
—
Vector operations at a glance
What each product returns and what it means.
| Operation | Notation | Result | Dimensions | Meaning |
|---|---|---|---|---|
| Dot product | u · v | Scalar | Any (2D, 3D, n-D) | Work done; how aligned two vectors are |
| Cross product | u × v | Vector | 3D (and 7D) | Torque, angular momentum, surface normals |
| Scalar projection | compv u | Scalar | Any | Length of u’s shadow along v |
| Vector projection | projv u | Vector | Any | The part of u parallel to v |
| Scalar triple product | u · (v × w) | Scalar | 3D | Signed volume of a parallelepiped |
Worked examples
Work done by a force
A force F = (10, 0, 5) N moves an object by d = (3, 4, 0) m.
Torque on a wrench
Position r = (0.5, 0, 0) m, force F = (0, 20, 0) N.
= (0, 0, 10) N·m
Angle between vectors
u = (3, 4, 0) and v = (1, 2, 2).
cos θ = 11 ÷ 15 = 0.7333
θ = 42.8334°
What is a vector?
A vector has both magnitude and direction and is written by its components, such as u = (3, 4, 0). Its magnitude is |u| = √(uₓ² + u_y² + u_z²), and dividing by it gives the unit vector û = u ÷ |u|, of length 1.
Formulas used
- Dot product: u · v = uₓvₓ + u_yv_y + u_zv_z = |u||v| cos θ.
- Angle: θ = arccos[(u · v) ÷ (|u||v|)], between 0° and 180°.
- Cross product: u × v = (u_yv_z − u_zv_y, u_zvₓ − uₓv_z, uₓv_y − u_yvₓ); its length |u||v| sin θ is the area of the parallelogram they span.
- Projection: projv u = [(u · v) ÷ |v|²] v and compv u = (u · v) ÷ |v|.
By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →
Sources
- Gibbs, J. W. & Wilson, E. B. (1901). Vector Analysis. Yale University Press.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics — notation for vectors and their products.
Frequently asked questions
Why is the dot product a scalar but the cross product a vector?
The dot product measures how much two vectors point the same way, which is a single number. The cross product produces a new vector perpendicular to both, whose length is the area of the parallelogram they span. In 2D there is no perpendicular direction within the plane, so the cross product reduces to one number (the z-component).
What does a zero dot product mean?
The vectors are perpendicular (orthogonal), provided neither is the zero vector, because cos 90° = 0. A negative dot product means the angle is obtuse; a positive one means it is acute.
What does a zero cross product mean?
The vectors are parallel or antiparallel (or one is zero), because sin 0° = sin 180° = 0. They span no area.
How does the right-hand rule fix the direction of the cross product?
Point the fingers of your right hand along u, curl them toward v, and your thumb points along u × v. Reversing the order reverses the direction: v × u = −(u × v).
What is the difference between scalar and vector projection?
The scalar projection is the signed length of u’s shadow along v. The vector projection is that length pointing along v’s direction. The difference u − projv u is the part of u perpendicular to v.
Why does the cross product only exist in 3D?
The construction needs a unique direction perpendicular to two given directions, which exists only in three dimensions (and, with a different algebra, in seven). In other dimensions the wedge product generalises it.
Related calculators
Continue with geometry.