Skip to content

shz_vec2_magnitude_fsrra

Markdown
SHZ_INLINE float shz_vec2_magnitude_fsrra(shz_vec2_t vec) SHZ_NOEXCEPT;

Returns the magnitude of the given 2D vector, unsafely, using FSRRA.

NameTypeDescription
vecshz_vec2_tThe vector whose magnitude is returned.

The magnitude of vec.

Faster alternative to shz_vec2_magnitude() which does not check for a zero-length vector.

  • Results in a division-by-zero when vec has a magnitude of 0.0f.
  • _fsrra: Uses FSRRA (fast approximate 1/sqrt(x)). The argument or denominator must be positive. Faster, less precise. (Naming and Suffixes)

shz_vec2_magnitude