Vector Magnitude
Find the length (magnitude) of a vector from its coordinates or from two points in 2D and 3D, the unit vector and direction cosines. Exact answer with roots.
The vector magnitude calculator finds the length (magnitude) of a vector from its coordinates or from the coordinates of its start and end points — in the plane and in space. It also finds the unit vector, the direction cosines and the angles between the vector and the coordinate axes. Coordinates can be fractions, and the answer is exact, for example √13/6.
Magnitude formulas
| Case | Formula |
|---|---|
| In the plane, a = (x, y) | |a| = √(x² + y²) |
| In space, a = (x, y, z) | |a| = √(x² + y² + z²) |
| Vector AB from points | AB = (xB − xA, yB − yA, zB − zA) |
| Unit vector | e = a / |a| |
| Direction cosines | cos α = x/|a|, cos β = y/|a|, cos γ = z/|a| |
Example 1. a = (2, −1, 2).
|a| = √(4 + 1 + 4) = √9 = 3, e = (2/3, −1/3, 2/3).
Example 2. A(1, 2), B(4, 6).
AB = (3, 4), |AB| = √(9 + 16) = 5.
The magnitude formula is the Pythagorean theorem: the coordinates are the legs of a right triangle (in space — the edges of a box), and the length of the vector is the hypotenuse (the diagonal). The squares of the direction cosines always add up to 1.
Linked Calculators
Comments
No comments yet.