alloy::math

Function bilinear

source
pub fn bilinear<T0, T1, T2, T3, R>(
    v00: &T0,
    v10: &T1,
    v01: &T2,
    v11: &T3,
    tx: f32,
    ty: f32,
) -> R
where T0: Lerp<T1>, T2: Lerp<T3>, T0::Output: Lerp<T2::Output, Output = R>,
Expand description

Interpolates between four values using a bilinear interpolation.

ยงParameters

  • v00 - The value at the top-left corner.
  • v10 - The value at the top-right corner.
  • v01 - The value at the bottom-left corner.
  • v11 - The value at the bottom-right corner.
  • tx - The interpolation factor along the x-axis.
  • ty - The interpolation factor along the y-axis.