# Normalizing Vectors

Normalizing Vectors

A nonzero vector is normalized by dividing it by its length. The resulting vector has length 1 and lies in the same direction.

In 2D, the length of is given by Pythagoras's formula: .

v=(x,y)

|v|=+

2

x

2

y

In 3D, the length of is .

v=(x,y,z)

|v|=++

2

x

2

y

2

z

In any dimension, the normalized vector of is .

v

v/|v|=v

v·v