Trait angular_units::Interpolate [] [src]

pub trait Interpolate: Angle {
    fn interpolate<U>(&self, right: &U, pos: Self::Scalar) -> Self
    where
        U: Clone + IntoAngle<Self, OutputScalar = Self::Scalar>
; fn interpolate_forward<U>(&self, right: &U, pos: Self::Scalar) -> Self
    where
        U: Clone + IntoAngle<Self, OutputScalar = Self::Scalar>
; }

A trait for linear interpolation between angles.

Required Methods

Perform a linear interpolation between two angles.

This method will always follow the shortest past between the two angles. This means it will go backward if the angles are more than a half turn apart. To force the interpolation to go forward, use interpolate_forward. The output is not normalized, and may exceed a full turn if it interpolates backward, even if both inputs are normalized. The angles may be represented in different units.

Perform a linear interpolation between two angles, going forward from self to right.

Unlike interpolate this will always go forward from self to right, even if going backward would take a shorter path. The output is not normalized, but should remain normalized if both self and right are. The angles may be represented in different units.

Implementors