COG Verb - VectorNorm

Normalizes a vector. Each axis of the vector is divided by the vector's length. This changes the vector proportionally so that it has a length of one. Syntax:

 normvec=VectorNorm(vector); 

The Math

 normvec=(x/|v|, y/|v|, z/|v|) 

Where |v| is the length of the vector.

Geometrical Application

Image:Vectornorm.gif

The given vector is shown in red. The green vector is the normalized result. The red vector could have any length, but the normalized result will always have a length of one.

  • Create:
This page was last modified 23:53, 2 April 2006.   This page has been accessed 244 times.