dash–calculator

01 Vectors and Coordinates

3D Unit Vector Calculator

Readout 01-0018 · Updated · Standard formula, shown below

Unit vector x 0.2857
Unit vector y
0.4286
Result, rounded to 4 decimal places
Unit vector z
0.8571
Result, rounded to 4 decimal places
Length of v
7.0000
Result, rounded to 4 decimal places
You enter
x component, y component, z component
You get
Unit vector x, Unit vector y, Unit vector z, Length of v
Rounding
4 dp

This calculator finds the unit vector in the direction of a 3D vector. Enter the x, y and z components; you get the three components of the unit vector û = v ÷ |v| and the length |v| of the original vector.

Formula

|v| = √(x² + y² + z²) and û = (x ÷ |v|, y ÷ |v|, z ÷ |v|).

  • x, y, z: the components of v
  • |v|: the magnitude (length) of v
  • û: the unit vector, length 1, same direction as v

Worked Example

Take v = (2, 3, 6).

  1. |v| = √(4 + 9 + 36) = √49 = 7.0000
  2. ûx = 2 ÷ 7 = 0.2857
  3. ûy = 3 ÷ 7 = 0.4286
  4. ûz = 6 ÷ 7 = 0.8571
  5. Check: 0.2857² + 0.4286² + 0.8571² ≈ 1

How to read the result

A unit vector keeps only the direction. Use it to give a direction to a force or velocity of known size (multiply û by the size), to find direction cosines (the components of û are cos α, cos β and cos γ), or to project another vector onto this direction with a dot product.

Limits and common mistakes

  • The zero vector has no direction, so it has no unit vector; the calculator shows Cannot compute.
  • For a 2D vector, enter z = 0.
  • Rounded components squared add to 1 only approximately.

Frequently Asked Questions

What is the unit vector of (3, 4, 0)?

(0.6, 0.8, 0), because the length is 5.

Is a unit vector always length 1?

Yes, by definition.

What are direction cosines?

The components of the unit vector: the cosines of the angles v makes with the x, y and z axes.

Does scaling v change its unit vector?

Not for a positive scale. A negative scale flips the unit vector.

Formula used
in x | x component | - | 2 | -
in y | y component | - | 3 | -
in z | z component | - | 6 | -
out ux | Unit vector x | - | x / sqrt(x^2 + y^2 + z^2) | 4
out uy | Unit vector y | - | y / sqrt(x^2 + y^2 + z^2) | 4
out uz | Unit vector z | - | z / sqrt(x^2 + y^2 + z^2) | 4
out m | Length of v | - | sqrt(x^2 + y^2 + z^2) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Photo collage: three thin coloured rods meeting at a corner of a wooden cube, and a close-up of an arrowhead on a weather vane.
Save this page: a 1000 × 1500 image of 3D Unit Vector Calculator.

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More on this panel

The whole Vectors and Coordinates panel →