Skip to content

shz_vec2_magnitude_inv_fsrra

Markdown
SHZ_INLINE float shz_vec2_magnitude_inv_fsrra(shz_vec2_t vec) SHZ_NOEXCEPT;

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

NameTypeDescription
vecshz_vec2_tThe vector whose inverse magnitude is returned.

1.0f divided by the magnitude of vec.

Faster alternative to shz_vec2_magnitude_inv() 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_inv