3.0.0 • Published 3 years ago
@thewhodidthis/arithmetics v3.0.0
about
Essential math utils to help with animating.
setup
Download from the the npm registry:
# Add to package.json
npm install @thewhodidthis/arithmetics
usage
Expect named exports for each function and a constant for TAU
as for example,
import * as math from "@thewhodidthis/arithmetics"
const degrees = math.deg(math.TAU)
console.assert(degrees, 360)
const radians = math.rad(180)
console.assert(radians, Math.PI)
const stretch = math.mag(3, 4)
console.assert(stretch, 5)
const percent = math.map(0.5, 0, 1, 0, 100)
console.assert(percent, 50)