paraxis 0.9.3

A simple rock-solid mathematics library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use num_traits::{PrimInt, Signed};

use crate::maths::vec::Vector;

impl<T: PrimInt + Signed, const N: usize> Vector<T, N> {
    pub fn dist_manhattan(&self, other: Self) -> T {
        self.inner
            .iter()
            .zip(other.inner.iter())
            .fold(T::zero(), |acc, x| acc + (*x.1 - *x.0).abs())
    }
}