PEXNormalizeVectors2D Utility


Synopsis

 
   int PEXNormalizeVectors2D(
       int count,
       PEXVector2D *vectors,
       PEXVector2D *vectors_return
   )
 

Arguments

count
The number of vectors to normalize.

vectors
A pointer to the array of vectors to normalize.

vectors_return
A pointer to an array in which to store the normalized vectors.

Returns

Zero if successful; otherwise, one of the following:

PEXBadVector
One of the vectors has zero magnitude.

Description

Invoke PEXNormalizeVectors2D to normalize each vector in the specified list of two-dimensional vectors.

This utility returns an error if any vector in the list has a magnitude of zero. However, this utility still normalizes all of the non-zero vectors in the list.

If the return array is the same as the input array, then this utility overwrites the input values with the normalized values.

Errors

None.

See Also

For a list of miscellaneous transformation utilities, see Miscellaneous Transformation Utilities. For a list of related topics, see PEXlib Utilities.