forked from M-Labs/nalgebra
Add delta-transformation.
This commit is contained in:
parent
ec160e5219
commit
f3ed302874
10
src/traits/delta_transform.rs
Normal file
10
src/traits/delta_transform.rs
Normal file
@ -0,0 +1,10 @@
|
||||
/// A delta-transformation is the generalization of rotation. A delta transform
|
||||
/// can apply any transformation to the object without translating it.
|
||||
/// In partilular, 0 is neutral wrt. the delta-transform.
|
||||
pub trait DeltaTransform<DT>
|
||||
{
|
||||
/// Extracts the delta transformation associated with this transformation.
|
||||
fn delta_transform(&self) -> DT;
|
||||
// FIXME: add functions to apply the delta-transform to a vector without
|
||||
// explicit computation of the transform (does this avoid some matrix copy?)
|
||||
}
|
4
src/traits/division_ring.rs
Normal file
4
src/traits/division_ring.rs
Normal file
@ -0,0 +1,4 @@
|
||||
use traits::ring::Ring;
|
||||
|
||||
pub trait DivisionRing : Ring + Quot<Self, Self>
|
||||
{ }
|
5
src/traits/ring.rs
Normal file
5
src/traits/ring.rs
Normal file
@ -0,0 +1,5 @@
|
||||
use core::num::{One, Zero};
|
||||
|
||||
pub trait Ring :
|
||||
Sub<Self, Self> + Add<Self, Self> + Neg<Self> + Mul<Self, Self> + One + Zero
|
||||
{ }
|
7
src/traits/vector_space.rs
Normal file
7
src/traits/vector_space.rs
Normal file
@ -0,0 +1,7 @@
|
||||
use core::num::Zero;
|
||||
use traits::division_ring::DivisionRing;
|
||||
use traits::workarounds::scalar_op::{ScalarMul, ScalarDiv};
|
||||
|
||||
pub trait VectorSpace<T: DivisionRing> : Sub<Self, Self> + Add<Self, Self> +
|
||||
Neg<Self> + Zero + ScalarMul<T> + ScalarDiv<T>
|
||||
{ }
|
Loading…
Reference in New Issue
Block a user