@hastearcade/snowglobe
Version:
A TypeScript port of CrystalOrb, a high-level Rust game networking library
14 lines • 399 B
JavaScript
export function remEuclid(lhs, rhs) {
const r = lhs % rhs;
return r < 0 ? r + Math.abs(rhs) : r;
}
export function cartesian(...a) {
return a.reduce((a, b) => a.flatMap((d) => b.map((e) => [d, e].flat())));
}
export function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
}
export function fract(value) {
return value % 1;
}
//# sourceMappingURL=math.js.map