Previous Up Next

2.38.2  Normalize a vector : normalize unitV

normalize or unitV takes as argument a vector.
normalize or unitV normalizes this vector for the l2 norm (the square root of the sum of the squares of its coordinates).
Input :

normalize([3,4,5])

Output :

[3/(5*sqrt(2)),4/(5*sqrt(2)),5/(5*sqrt(2))]

Indeed : x=3, y=4, z=5 and 50=|x|2+|y|2+|z|2.


Previous Up Next