Linear Algebra, Interactive EditionXYZ Homework Edition

⇩ Download ▾

0.5 Unit Vectors and Direction

A unit vector is a vector of length 11. Since its length is fixed, a unit vector carries exactly one piece of information — a direction — and that is what unit vectors are for: they are directions, packaged as vectors. The most important ones point along the axes. In 3\mathbb{R}^3 they are

𝐞 1 = ( 1 , 0 , 0 ) , 𝐞 2 = ( 0 , 1 , 0 ) , 𝐞 3 = ( 0 , 0 , 1 ) \mathbf{e}_1 = (1, 0, 0), \qquad \mathbf{e}_2 = (0, 1, 0), \qquad \mathbf{e}_3 = (0, 0, 1)

the standard unit vectors; physics texts call them 𝐢\mathbf{i}, 𝐣\mathbf{j}, 𝐤\mathbf{k}. In n\mathbb{R}^n there are nn of them, 𝐞i\mathbf{e}_i having a 11 in position ii and zeros elsewhere. The staircase of Section 0.2 is a statement about them: walking 22 along the first axis, 11 along the second and 22 up is 2𝐞1+𝐞2+2𝐞32\mathbf{e}_1 + \mathbf{e}_2 + 2\mathbf{e}_3, and in general

( v 1 , v 2 , v 3 ) = v 1 𝐞 1 + v 2 𝐞 2 + v 3 𝐞 3 (v_1, v_2, v_3) = v_1 \mathbf{e}_1 + v_2 \mathbf{e}_2 + v_3 \mathbf{e}_3

An expression of this shape — vectors scaled and added — is called a linear combination, and the whole of Chapter 2 is about them. Here the combination is a bookkeeping device: it says that the standard unit vectors, scaled by the components, rebuild any vector.

Every other direction has a unit vector too, and the recipe for it is the subject of the figure: divide a vector by its own length.

A wireframe globe of radius 1 centered at the origin, its mesh drawn in fine pale lines so that anything inside it stays visible. A thin shaded arrow runs from the origin to the point (a, b, c), the vector v, whose three components are set by three sliders starting at 2, 1 and 2. A shorter, much thicker arrow runs from the origin along the same direction and stops exactly at the globe's surface: the unit vector in the direction of v, wrapped around the first part of the thin one. At the starting values v has length exactly 3, so the thick arrow covers the first third of the thin one. Dragging any slider swings the thin arrow to its new tip, and the thick arrow turns with it while its tip slides over the globe's surface, never leaving it and never reaching past it. As a slider approaches zero the thin arrow shortens without ever turning round, and with all three at zero both arrows vanish, since the zero vector has neither a length to draw nor a direction to point in.Explore in 3D (opens in a new tab)
The thin arrow is 𝐯=(a,b,c)\mathbf{v} = (a, b, c), its components on three sliders; the short thick arrow along the same direction is the unit vector 𝐯/|𝐯|\mathbf{v}/|\mathbf{v}|. The wire globe is the set of all unit vectors' tips, and the thick arrow's tip never leaves it.

Explore the figure

  1. At the starting values 𝐯=(2,1,2)\mathbf{v} = (2, 1, 2), a vector of length 33. The thick arrow covers exactly the first third of the thin one and ends at (2/3,1/3,2/3)(2/3, \; 1/3, \; 2/3), on the globe: dividing by 33 took the length to 11 and changed nothing else.
  2. Drag aa to 2-2. Now 𝐯=(2,1,2)\mathbf{v} = (-2, 1, 2), still of length 33, and the thick arrow's tip has slid across the globe to (2/3,1/3,2/3)(-2/3, \; 1/3, \; 2/3). Same length, new direction, new unit vector.
  3. Set a=0a = 0 and b=0b = 0, leaving c=2c = 2. The thin arrow points straight up and the thick one is 𝐞3=(0,0,1)\mathbf{e}_3 = (0, 0, 1), the north pole of the globe. The standard unit vectors are what this recipe produces from vectors along the axes.
  4. Keep a=0a = 0 and b=0b = 0 and drag cc down to 00. The thin arrow shrinks to nothing, and the thick one vanishes with it. The zero vector has no direction, so it has no unit vector — the recipe divides by |𝐯|=0|\mathbf{v}| = 0 and rightly refuses.
  5. Set a=1a = 1, b=2b = 2 and c=2c = 2. The length is 33 once more, and the unit vector is (1/3,2/3,2/3)(1/3, \; 2/3, \; 2/3). Three sliders, but the globe is a surface: the unit vector has only two degrees of freedom, because it has forgotten the length.

Dividing by the length

Take any nonzero 𝐯\mathbf{v} and set 𝐮=1|𝐯|𝐯\mathbf{u} = \dfrac{1}{|\mathbf{v}|} \mathbf{v}, a scalar multiple with the positive scalar 1/|𝐯|1/|\mathbf{v}|. Because the scalar is positive, 𝐮\mathbf{u} points the way 𝐯\mathbf{v} points. Because scaling multiplies length by the scalar, |𝐮|=1|𝐯||𝐯|=1|\mathbf{u}| = \dfrac{1}{|\mathbf{v}|} |\mathbf{v}| = 1. So 𝐮\mathbf{u} is the unit vector in the direction of 𝐯\mathbf{v} — there is only one, since two unit vectors in the same direction are the same arrow — and in components

𝐯 | 𝐯 | = ( v 1 | 𝐯 | , v 2 | 𝐯 | , , v n | 𝐯 | ) \frac{\mathbf{v}}{|\mathbf{v}|} = \left( \frac{v_1}{|\mathbf{v}|}, \; \frac{v_2}{|\mathbf{v}|}, \; \dots, \; \frac{v_n}{|\mathbf{v}|} \right)

Reversing the recipe builds a vector of any length you like. To point the way 𝐯\mathbf{v} points but have length LL, take LL copies of the unit vector: L𝐯/|𝐯|L \, \mathbf{v}/|\mathbf{v}| has direction 𝐯\mathbf{v} and length L·1=LL \cdot 1 = L.

11
The figure's unit vector really has length 1 ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The figure's unit vector really has length 1, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The thick arrow at the figure's starting values, measured: exactly 11. Dividing by the length worked, and the answer is the integer rather than a decimal that rounds to it.

1313
The worked example's length ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The worked example's length, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The length of (3,4,12)(3, -4, 12): 1313, the number every component is about to be divided by.

11
And its unit vector ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text And its unit vector, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The same vector after that division. Length 11, exactly — which is what makes the fractions the honest answer and 0.2310.231 an approximation to one of them.

1010
The prescribed length, checked ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The prescribed length, checked, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

Ten copies of the unit vector in the direction of (1,2,2)(1, 2, -2): length 1010, as required. The recipe is scale to 11, then scale to whatever you wanted.

An original work of XYZ Homework, built around interactive XYZ 3D figures. Its chapter sequence is aligned to Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL); this work is original, copies nothing from it, and is not affiliated with or endorsed by its authors. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.