lerp

Returns the number a fraction t of the way from a to b. t is not clamped, so a value past 1 overshoots.

@internote/canvas-sdkFunction
On this page
import { lerp } from '@internote/canvas-sdk';

#Signature

(a: number, b: number, t: number): number

#Parameters

a
The value at t = 0.
b
The value at t = 1.
t
How far from a towards b.

#Example

lerp: (from, to, t) => ({ lat: lerp(from.lat, to.lat, t), lon: lerp(from.lon, to.lon, t) }),

Declared in packages/canvas-sdk/src/geometry/vec2.ts:24.

Last updated