Skip to content

format

typescript
Mathf.Lerp(left, right, t)

class: Mathf

description

Performs a linear interpolation between the left and right values using the specified value.

parameter

param_nametypedescription
leftnumberThe left value.
rightnumberThe right value.
tnumberThe specified value.

return

typedescription
numberThe interpolated float value between the two input float values.

code example

typescript
// Performs a linear interpolation between q1 and q2 using t.
let lerp = Mathf.Lerp(1, 2, 0.5); // lerp = 1.5