everyutil
Version:
A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.
16 lines (15 loc) • 407 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.lerp = void 0;
/**
* Linear interpolation between two numbers.
* @author @dailker
* @param {number} a - Start value.
* @param {number} b - End value.
* @param {number} t - Interpolation factor [0, 1].
* @returns {number}
*/
function lerp(a, b, t) {
return a + (b - a) * t;
}
exports.lerp = lerp;