npm install --save @kobayami/math-utils
Some little math helper functions that cover the following areas:
- Division and modulo
- Lerp functions (linear interpolation)
- Clamp functions
- Root and logarithm
- Sign and integer
- Rounding
import { mod, divFloor, divTrunc } from "@kobayami/math-utils/lib";
const two = mod(-13, 5);
const minusThree = divFloor(-13, 5);
const minusTwo = divTrunc(-15, 5);