Lerp

Math
Tanto lado del cliente como del usuario
Disponible en PC y móvil

Linear interpolation, returns the value corresponding to the interpolation progress between the start value and the target value, the interpolation coefficient is [0,1]

Declaración

func Lerp(valueA float, valueB float, valueT float) float
go

Parámetros

Entrada

Nombre Tipo Descripción
ValueA Float The starting value of linear interpolation. This value is returned when the interpolation progress is 0
ValueB Float The target value of linear interpolation. This value is returned when the interpolation progress is 1
ValueT Float Interpolation progress, the value range is [0,1]. When the value is 0, it returns the start value, when the value is 1, it returns the target value, and when the value is 0.5, it returns the average of the start value and the target value.

Regresar

Tipo Descripción
Float Linear interpolation return value