ear-algae 0.5.0

Linear algebra featuring Vectors, Normal Vectors, Matrices, Rotors (Unit Quaternions) and Rigid Transforms (Rotation + Translation)
Documentation
1
2
3
4
5
6
7
8
9
use lerpify::LinearCombination;

use crate::{Vect, traits::Ring};

impl<const N: usize, S: Ring> LinearCombination<S> for Vect<N, S> {
    fn linear_combination<const L: usize>(terms: [(Self, S); L]) -> Self {
        terms.into_iter().fold(Vect::ZERO, |c, n| c + (n.0 * n.1))
    }
}