Skip to content
Glacius
Linear algebraConcept reference

Unit vectors

Normalizing a nonzero vector divides each coordinate by its Euclidean length.

On this page 7 sections
  1. Overview
  2. A unit vector has Euclidean length 1
  3. The zero vector cannot be normalized: its length is 0, so the rule would divide by zero
  4. Check your understanding
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01A unit vector has Euclidean length 1#

A unit vector has Euclidean length 11. Normalizing a nonzero vector keeps its direction and changes its length to 11.

Two arrows share the origin and direction. The dashed vector has coordinates(1.2,1.6) and length2. The solid vector has coordinates(0.6,0.8) and length1. Equal axis scales preserve this2-to-1 ratio.Two arrows share the origin and direction. The dashed vector has coordinates(1.2,1.6) and length2. The solid vector has coordinates(0.6,0.8) and length1. Equal axis scales preserve this2-to-1 ratio.
Figure 1The same positive scale factor acts on every coordinate.
Link to this figure ↗Download SVGDownload PNG

Start with v=(3,4)v=(3,4). Its length is 55, so divide both coordinates by 55. Each coordinate keeps its sign.

The normalized vector is u.

u=(3/5,4/5)u=(3/5,4/5)

Check u=(3/5,4/5)u=(3/5,4/5): its squared coordinates sum to 9/25+16/25=19/25+16/25=1, so its length is 11. Using the same positive divisor preserves the direction.

For a nonzero vector v.

u=v/v2u=v/\|v\|_2
Check your reasoning

Normalize v=(6,8)v=(-6,8). What is the first coordinate of the result?

Show answer and explanation
-0.6

The length is 1010. Divide the first coordinate: 6/10=0.6-6/10=-0.6.

02The zero vector cannot be normalized: its length is 0, so the rule would divide by zero#

The zero vector cannot be normalized: its length is 00, so the rule would divide by zero. A vector already of length 11 stays unchanged.

A negative direction stays negative.

(0,7)/7=(0,1)(0,-7)/7=(0,-1)
Check your reasoning

Command x: 8, y: 6. Which unit command keeps its direction?

  1. A(1,1)(1,1)
  2. B(4/5,3/5)(4/5,3/5)
  3. C(4/5,3/5)(-4/5,-3/5)
Show answer and explanation
(4/5,3/5)(4/5,3/5)

Divide both entries by the length 1010.

03Check your understanding#

Check your reasoning

A program normalizes (0,0)(0,0) to (0,0)(0,0). What fails?

  1. AIt still has length 0.
  2. BUse (1,1) instead.
  3. CUse (1,0) instead.
Show answer and explanation
It still has length 0.

The divisor is zero; normalization is undefined.

Key takeaway

Divide every coordinate by the same positive length. Zero cannot be normalized.

  • Normalize a nonzero vector to unit length

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Unit vectors.” Math behind ML. /learn/la-normalize