Skip to content

Function: lerp()

ts
function lerp(
   start, 
   end, 
   t): number;

Linear interpolation between start and end at t (typically 0–1). 在 startend 之间按 t 线性插值(t 通常为 0–1)。

Parameters

ParameterTypeDescription
startnumberStart value / 起点
endnumberEnd value / 终点
tnumberInterpolation factor / 插值系数

Returns

number

Interpolated value / 插值结果

Example

ts
lerp(0, 100, 0.5) // => 50

Since

1.0.0

Released under the MIT License.