UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

12 lines (11 loc) • 580 B
/** * Get the next damped value for a given factor. * * @param {number} targetValue The final value. * @param {number} currentValue The current value. * @param {number} [factor=0.5] The factor used to reach the target value, defaults to `0.5`. * @param {number} [precision=0.01] The precision used to calculate the latest value, defaults to `0.01`. * @return {number} The next value. * @link https://js-toolkit.studiometa.dev/utils/math/damp.html */ export declare function damp(targetValue: number, currentValue: number, factor?: number, precision?: number): number;