Skip to content

shz_vec2_project_safe

Markdown
SHZ_INLINE shz_vec2_t shz_vec2_project_safe(shz_vec2_t vec, shz_vec2_t onto) SHZ_NOEXCEPT;

Returns the resulting vector from projecting the given 2D vector along the given (unit) axis.

NameTypeDescription
vecshz_vec2_t
ontoshz_vec2_t

shz_vec2_t

  • This routine should safely return the zero vector when vec has a magnitude of 0.0f.
  • _safe: Guards degenerate input (zero-length vectors, zero denominators) at a small cost. (Naming and Suffixes)