Linearly interpolates between two numbers.
lerp(0, 10, 0.5); // => 5lerp(5, 15, 0.2); // => 7lerp(-10, 10, 0.75); // => 5
npx atmx add helper lerp
Copy and paste the following method into @/utils/helpers/undefined.ts:
@/utils/helpers/undefined.ts
/*** Linearly interpolates between two numbers.** @example* lerp(0, 10, 0.5) // => 5* lerp(5, 15, 0.2) // => 7* lerp(-10, 10, 0.75) // => 5*/export function lerp(from: number, to: number, amount: number): number {return from + (to - from) * amount;}