[Home] >  Math >  Calculate the linear interpolation between two numbers

Calculate the linear interpolation between two numbers

JavaScript version

const lerp = (a, b, amount) => (1 - amount) * a + amount * b;

TypeScript version

const lerp = (a: number, b: number, amount: number): number => (1 - amount) * a + amount * b;