Reduce reliance on nalgebra

This commit is contained in:
Hanno Braun 2025-03-21 22:41:13 +01:00
parent 7c17362693
commit d84103ce6e

View File

@ -1,5 +1,7 @@
use std::{fmt, ops};
use iter_fixed::IntoIteratorFixed;
use crate::Bivector;
use super::{
@ -323,7 +325,14 @@ where
type Output = Self;
fn add(self, rhs: V) -> Self::Output {
self.to_na().add(rhs.into().to_na()).into()
let components = self
.components
.into_iter_fixed()
.zip(rhs.into().components)
.map(|(a, b)| a + b)
.collect();
Self { components }
}
}