length

From OpenGL Reference
Jump to navigation Jump to search

Calculate the length of a vector.

Declaration[edit]

float length( genType x );
double length( genDType x );


Parameters[edit]

x - Specifies a vector of which to calculate the length.


Description[edit]

 length returns the length of the vector, i.e. $\sqrt { { x[0] }^2 + { x[1] }^2 + \dots }$.


Version Support[edit]

length (genType) 1.1+
length (genDType) 4.0+

See Also[edit]

 distance , normalize 


Copyright[edit]

Copyright© 2011-2014 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/.