MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / normalize

Function normalize

Source/astcenc_vecmathlib.h:353–357  ·  view source on GitHub ↗

* @brief Normalize a non-zero length vector to unit length. */

Source from the content-addressed store, hash-verified

351 * @brief Normalize a non-zero length vector to unit length.
352 */
353static ASTCENC_SIMD_INLINE vfloat4 normalize(vfloat4 a)
354{
355 vfloat4 length = dot(a, a);
356 return a / sqrt(length);
357}
358
359/**
360 * @brief Normalize a vector, returning @c safe if len is zero.

Callers 4

TESTFunction · 0.85

Calls 2

dotFunction · 0.70
sqrtFunction · 0.70

Tested by 1

TESTFunction · 0.68