Module ludomath::num [] [src]

A small collection of numeric functions.

Functions

clamp

Clamps num to the range [a, b].

inv_sqrt

Quickly, but roughly, approximates 1/sqrt(x).

lerp

Linearly interpolates from start to end by t.

lerp_clamped

Linearly inpterpolates from start to end by t.

modulo

Calculates num modulo denom.

range_map

Maps a value relative to some range to the corresponding value relative to another range.