cvmath 0.1.2

Computer Graphics Vector Math Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
/// Types which can be linearly interpolated.
pub trait Lerp: Copy {
	type T;

	fn lerp(self, other: Self, t: Self::T) -> Self;
}

/// Linearly interpolates between `start` and `end` by `t`.
#[inline]
pub fn lerp<T: Lerp>(start: T, end: T, t: T::T) -> T {
	start.lerp(end, t)
}