normalize

From OpenGL Reference
Jump to navigation Jump to search

Calculates the unit vector in the same direction as the original vector.

Declaration[edit]

genType normalize( genType v );
genDType normalize( genDType v );


Parameters[edit]

v - Specifies the vector to normalize.


Description[edit]

 normalize returns a vector with the same direction as its parameter, v , but with length 1.


Version Support[edit]

normalize (genType) 1.1+
normalize (genDType) 4.0+

See Also[edit]

 length 


Copyright[edit]

Copyright© 2011-2017 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.