format
typescript
Vector4.Lerp(lhs, rhs, t)class: Vector4
description
Linearly interpolates between two vectors, lhs and rhs, based on a given interpolation parameter t, and returns the interpolated result.
parameter
| param_name | type | description |
|---|---|---|
| lhs | Vector4 | The starting vector. |
| rhs | Vector4 | The ending vector. |
| t | number | The interpolation parameter, ranging from [0, 1]. When t is 0, lhs is returned. When t is 1, rhs is returned. The interpolation is calculated based on t for values in between. |
return
| type | description |
|---|---|
Vector4 | Returns a new Vector4 object representing the result of linear interpolation based on the interpolation parameter t. |
code example
typescript
let lhs = new Vector4(1, 2, 3, 4);
let rhs = new Vector4(3, 4, 5, 6);
let lerp_v4 = Vector4.Lerp(lhs, rhs, 0.5);