14.1.2 Normalizing a vector
The
normalize
or
unitV
command finds the unit vector in the direction of a given vector.
normalize
takes
V
, a vector (list).
normalize(
V
)
normalizes this vector for the ℓ
2
norm (the square root of the sum of the squares of its coordinates).
Example
normalize
([3,4,5])
⎡
⎢
⎢
⎢
⎢
⎣
3
5
√
2
,
4
5
√
2
,
5
5
√
2
⎤
⎥
⎥
⎥
⎥
⎦