Unit Vectors

"Which way is north?" doesn't need a length attached to it — north is a direction, full stop. Sometimes a vector is carrying more information than you actually want: you only care which way it points, not how long it is. A unit vector is a vector of length exactly 1 — pure direction, with the magnitude stripped away. We mark it with a hat: \hat{v}.

To turn any non-zero vector into a unit vector pointing the same way, divide it by its own length. This is called normalizing:

\hat{v} = \frac{\vec{v}}{\lVert \vec{v} \rVert}.

Why does this always work out to exactly 1? Dividing by \lVert\vec{v}\rVert is just scaling the vector by the number 1/\lVert\vec{v}\rVert. Scaling by a positive number never flips direction — it only stretches or shrinks. And scaling a vector by k always scales its length by the same factor: \lVert k\vec{v}\rVert = |k|\,\lVert\vec{v}\rVert. Plug in k = 1/\lVert\vec{v}\rVert and the length becomes \frac{1}{\lVert\vec v\rVert}\cdot\lVert\vec v\rVert = 1 — guaranteed, for any non-zero vector you start with.

Standing on the unit circle

Steer \vec{v} below. The short bold arrow is its normalized version \hat{v} — same heading, but its tip always lands on the unit circle (radius 1), no matter how long you stretch \vec{v}, and no matter which of the four quadrants it points into.

Worked example: normalize (3, 4)

Take \vec{v} = \begin{bmatrix} 3 \\ 4 \end{bmatrix}. Its magnitude is the familiar \lVert\vec v\rVert = \sqrt{3^2+4^2} = \sqrt{25} = 5, so normalizing means dividing each component by 5:

\hat{v} = \frac{1}{5}\begin{bmatrix} 3 \\ 4 \end{bmatrix} = \begin{bmatrix} 0.6 \\ 0.8 \end{bmatrix}.

Check the promise by squaring and adding: \lVert\hat v\rVert = \sqrt{0.6^2 + 0.8^2} = \sqrt{0.36 + 0.64} = \sqrt{1} = 1. It really does land on the unit circle, exactly as advertised — every time, for every starting vector.

Worked example: which way is the wind blowing?

A weather station measures a wind force vector \vec{F} = \begin{bmatrix} -6 \\ 8 \end{bmatrix} newtons — it doesn't care how hard the wind pushes, only which way. First find the magnitude: \lVert\vec F\rVert = \sqrt{(-6)^2+8^2} = \sqrt{36+64} = \sqrt{100} = 10. Then divide every component by that 10:

\hat{F} = \frac{1}{10}\begin{bmatrix} -6 \\ 8 \end{bmatrix} = \begin{bmatrix} -0.6 \\ 0.8 \end{bmatrix}.

\hat F tells you exactly which way the wind pulls — up and to the left — with the "how hard" completely removed. If the wind doubled in strength tomorrow, \vec F would change, but \hat F would stay exactly the same: the direction hasn't moved, only the strength has.

Worked example: the exact opposite direction

A wall pushes back on you with a reaction force that points exactly opposite to the force you push with. If your push has unit direction \hat{u} = \begin{bmatrix} 0.6 \\ 0.8 \end{bmatrix}, the wall's reaction points along -\hat{u} = \begin{bmatrix} -0.6 \\ -0.8 \end{bmatrix} — just flip the sign of every component. Check it's still a unit vector: \lVert -\hat u\rVert = \sqrt{(-0.6)^2+(-0.8)^2} = \sqrt{0.36+0.64} = 1, because squaring erases the minus signs, exactly as it did for magnitude. Negating a unit vector always gives another unit vector — it reverses the direction but can never change the length.

The standard unit vectors

Two unit vectors are so useful they get their own names. \hat{\imath} points one step along x, and \hat{\jmath} points one step along y:

\hat{\imath} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \qquad \hat{\jmath} = \begin{bmatrix} 0 \\ 1 \end{bmatrix}.

Every vector is a linear combination of these two: \begin{bmatrix} 3 \\ 2 \end{bmatrix} = 3\hat{\imath} + 2\hat{\jmath}. They are the standard yardsticks the whole coordinate grid is measured against — the first hint that a couple of well-chosen unit vectors can describe absolutely everything. Step up to three dimensions and a third partner, \hat{k} = \begin{bmatrix}0\\0\\1\end{bmatrix}, joins the pair to cover height as well as east and north.

Worked example: a unit vector with an irrational component

Not every unit vector comes out as tidy decimals. Take \vec{v} = \begin{bmatrix} 1 \\ 1 \end{bmatrix}. Its magnitude is \lVert\vec v\rVert = \sqrt{1^2+1^2} = \sqrt{2}, so normalizing means dividing by \sqrt{2}:

\hat{v} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1 \\ 1 \end{bmatrix} = \begin{bmatrix} \tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} \end{bmatrix} \approx \begin{bmatrix} 0.71 \\ 0.71 \end{bmatrix}.

Squaring and adding still checks out exactly: \left(\tfrac{1}{\sqrt2}\right)^2 + \left(\tfrac{1}{\sqrt2}\right)^2 = \tfrac12+\tfrac12 = 1. A unit vector's components don't have to be nice numbers — they only have to satisfy that one equation. In fact, every unit vector in the plane is secretly a cosine and a sine: the vector that makes angle \theta with the x-axis is always \begin{bmatrix}\cos\theta \\ \sin\theta\end{bmatrix}, which is exactly why it automatically has length 1 — that's the identity \cos^2\theta+\sin^2\theta=1 in disguise.

Two traps that catch almost everyone the first time round:

Open up any 3D game engine and you'll find surface normals — little arrows sticking straight out of every triangle of a 3D model, recording which way each tiny patch of surface faces. Engines always store these as unit vectors. Why bother normalizing them? Because the lighting formula compares a surface normal against the direction to a light using the dot product, and that formula only gives a clean "how much does this surface face the light" answer when both vectors have length 1. Skip the normalizing step and some triangles in a 3D model quietly render too bright or too dark — a classic graphics bug caused by nothing more exotic than a forgotten division.

When a streaming service decides two songs are "similar," it often represents each song as a long vector of numbers (tempo, loudness, genre weights, and hundreds more) and then normalizes every one of them into a unit vector before comparing. Why bother? Because normalizing removes any difference in overall "loudness" of the vector's numbers, leaving only the pattern — the direction — behind. Two songs with wildly different raw numbers but the same underlying balance of features end up pointing almost the same way once normalized, and get recommended together. It's the very same division-by-length trick from this page, just running on data instead of arrows on a page.

Every time a ship's compass reports a heading — "bearing zero-nine-zero, due east" — it is handing over a unit vector in disguise. A compass never tells you how far you've travelled, only which way you're pointed: that's a magnitude-free, direction-only description, which is exactly what a unit vector is built to store. Sailors were normalizing vectors centuries before anyone wrote the word "vector" down.

See it explained