7 lines
240 B
JavaScript
7 lines
240 B
JavaScript
import { toDecimal } from './to-decimal.mjs';
|
|
|
|
const smoothFrame = (prevValue, nextValue, duration, smoothing = 0) => toDecimal(prevValue +
|
|
(duration * (nextValue - prevValue)) / Math.max(smoothing, duration));
|
|
|
|
export { smoothFrame };
|