[][src]Trait bestagon::lerp::LinearInterpolation

pub trait LinearInterpolation {
    fn lerp(&self, to: &Self, t: f32) -> Self;
}

Required methods

fn lerp(&self, to: &Self, t: f32) -> Self

Loading content...

Implementations on Foreign Types

impl LinearInterpolation for f32[src]

Loading content...

Implementors

impl LinearInterpolation for Axial[src]

fn lerp(&self, to: &Axial, t: f32) -> Axial[src]

use bestagon::{coords::Axial, lerp::LinearInterpolation};
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.00), Axial(0, 0));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.25), Axial(1, -1));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.49), Axial(2, -2));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.51), Axial(3, -2));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 0.75), Axial(4, -3));
assert_eq!(Axial(0, 0).lerp(&Axial(5, -4), 1.00), Axial(5, -4));

impl LinearInterpolation for Cube[src]

fn lerp(&self, to: &Cube, t: f32) -> Cube[src]

use bestagon::{coords::Cube, lerp::LinearInterpolation};
assert_eq!(Cube(0, 0, 0).lerp(&Cube(5, -4, -1), 0.00), Cube(0, 0, 0));
assert_eq!(Cube(0, 0, 0).lerp(&Cube(5, -4, -1), 0.25), Cube(1, -1, 0));
assert_eq!(Cube(0, 0, 0).lerp(&Cube(5, -4, -1), 0.49), Cube(2, -2, 0));
assert_eq!(Cube(0, 0, 0).lerp(&Cube(5, -4, -1), 0.51), Cube(3, -2, -1));
assert_eq!(Cube(0, 0, 0).lerp(&Cube(5, -4, -1), 0.75), Cube(4, -3, -1));
assert_eq!(Cube(0, 0, 0).lerp(&Cube(5, -4, -1), 1.00), Cube(5, -4, -1));
Loading content...