UNPKG

es-next-tools

Version:

A comprehensive utility library for JavaScript and TypeScript that provides a wide range of functions for common programming tasks, including mathematical operations, date manipulations, array and object handling, string utilities, and more.

13 lines (12 loc) 377 B
/** * Performs linear interpolation between two numbers. * @param {number} start - The start value. * @param {number} end - The end value. * @param {number} t - The interpolation factor (0-1). * @returns {number} The interpolated value. * @example * const result = lerp(0, 10, 0.5); // 5 */ export function lerp(start, end, t) { return start + (end - start) * t; }