This commit is contained in:
Quaternions 2024-08-27 14:23:20 -07:00
parent a097e3945f
commit 047451d247
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,17 @@
use std::ops::Add;
use fixed_wide_traits::wide::WideDot;
pub struct Affine<M,T>{
pub matrix:M,
pub offset:T,
}
impl<M:Copy,T:Copy> Affine<M,T>{
pub fn wide_transform<X>(&self,input:X)-><<M as WideDot<X>>::Output as Add<T>>::Output
where
M:WideDot<X>,
<M as WideDot<X>>::Output:Add<T>,
{
self.matrix.wide_dot(input)+self.offset
}
}

View File

@ -1,6 +1,9 @@
mod macros; mod macros;
mod vector; mod vector;
#[cfg(feature="fixed_wide_traits")]
pub mod affine;
pub use vector::Vector2; pub use vector::Vector2;
pub use vector::Vector3; pub use vector::Vector3;
pub use vector::Vector4; pub use vector::Vector4;