Trait interpolation::Lerp

source ·
pub trait Lerp {
    type Scalar;

    // Required method
    fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self;
}
Expand description

Describes a type that can linearly interpolate between two points.

Required Associated Types§

source

type Scalar

The scaling type for linear interpolation.

Required Methods§

source

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

Given self and another point other, return a point on a line running between the two that is scalar fraction of the distance between the two points.

Implementations on Foreign Types§

source§

impl Lerp for u16

§

type Scalar = f32

source§

fn lerp(&self, other: &u16, scalar: &f32) -> u16

source§

impl<T> Lerp for [T; 2]where T: Lerp,

§

type Scalar = <T as Lerp>::Scalar

source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

source§

impl Lerp for i16

§

type Scalar = f32

source§

fn lerp(&self, other: &i16, scalar: &f32) -> i16

source§

impl Lerp for f64

§

type Scalar = f64

source§

fn lerp(&self, other: &f64, scalar: &f64) -> f64

source§

impl Lerp for i8

§

type Scalar = f32

source§

fn lerp(&self, other: &i8, scalar: &f32) -> i8

source§

impl<T> Lerp for [T; 3]where T: Lerp,

§

type Scalar = <T as Lerp>::Scalar

source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

source§

impl<T> Lerp for [T; 5]where T: Lerp,

§

type Scalar = <T as Lerp>::Scalar

source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

source§

impl<T> Lerp for [T; 1]where T: Lerp,

§

type Scalar = <T as Lerp>::Scalar

source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

source§

impl Lerp for f32

§

type Scalar = f32

source§

fn lerp(&self, other: &f32, scalar: &f32) -> f32

source§

impl Lerp for i32

§

type Scalar = f32

source§

fn lerp(&self, other: &i32, scalar: &f32) -> i32

source§

impl Lerp for u32

§

type Scalar = f32

source§

fn lerp(&self, other: &u32, scalar: &f32) -> u32

source§

impl Lerp for u8

§

type Scalar = f32

source§

fn lerp(&self, other: &u8, scalar: &f32) -> u8

source§

impl<T> Lerp for [T; 4]where T: Lerp,

§

type Scalar = <T as Lerp>::Scalar

source§

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self

source§

impl Lerp for u64

§

type Scalar = f64

source§

fn lerp(&self, other: &u64, scalar: &f64) -> u64

source§

impl Lerp for i64

§

type Scalar = f64

source§

fn lerp(&self, other: &i64, scalar: &f64) -> i64

Implementors§