-
Notifications
You must be signed in to change notification settings - Fork 2
lerp
Subhajit Sahu edited this page Aug 9, 2022
·
1 revision
Linearly interpolate a bigint between two bigints.
function lerp(x, y, t)
// x: start bigint
// y: stop bigint
// t: interpolant ∈ [0, 1]
const xbigint = require('extra-bigint');
xbigint.lerp(80n, 320n, 0.8);
// → 272n
xbigint.lerp(80n, 320n, 0.20);
// → 128n
xbigint.lerp(80n, 320n, 0.32);
// → 156n