UNPKG

@studiometa/js-toolkit

Version:

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

11 lines (10 loc) • 483 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. * @param {number} [precision=0.01] The precision used to calculate the latest value. * @returns {number} The next value. */ export declare function damp(targetValue: number, currentValue: number, factor?: number, precision?: number): number;