lerp.php
Table of Contents
Functions
- lerp() : float
- Linearly interpolates between two values.
Functions
lerp()
Linearly interpolates between two values.
lerp(float $a, float $b, float $t) : float
Computes $a + ( $b - $a ) * $t. The factor $t is not bounded: values outside
the [0, 1] range extrapolate beyond the [$a, $b] segment.
Parameters
- $a : float
-
The start value (returned when
$t === 0.0). - $b : float
-
The end value (returned when
$t === 1.0). - $t : float
-
The interpolation factor, typically in
[0, 1].
Tags
Return values
float —The interpolated value.