pub fn lerp_vec<T, const D: usize>(
x: &Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>,
y: &Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>,
a: &Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>,
) -> Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>where
T: Number,
Expand description
Returns x * (1.0 - a) + y * a
, i.e., the component-wise linear blend of x
and y
using the components of
the vector a
as coefficients.
The value for a is not restricted to the range [0, 1]
.
This is an alias for mix_vec
.
§Examples:
let x = glm::vec3(1.0, 2.0, 3.0);
let y = glm::vec3(10.0, 20.0, 30.0);
let a = glm::vec3(0.1, 0.2, 0.3);
assert_eq!(glm::lerp_vec(&x, &y, &a), glm::vec3(1.9, 5.6, 11.1));