Help end child hunger

Vector Length

Prev: Catmull-Rom Spline Next: Cross Product
 

The length of a vector v(x,y,z) can be computed as

mag = \sqrt[]{x^{2} + y^{2} + z^{2}}

In CG, we normally need a vector which is unit length, aka a normalized vector. To obtain a normalized vector just divide its components by the vector’s magnitude.

  \displaystyle n = \frac{v}{|v|}

i.e., the components of vector n will be:

\displaystyle n = (\frac{x}{mag}, \frac {y}{mag}, \frac{z}{mag})

 

Prev: Catmull-Rom Spline Next: Cross Product
 

Leave a Reply

(required)

(required)


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2014 Lighthouse3d.com Suffusion theme by Sayontan Sinha