Add delta-transformation.
This commit is contained in:
parent
ec160e5219
commit
f3ed302874
|
@ -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?)
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
use traits::ring::Ring;
|
||||
|
||||
pub trait DivisionRing : Ring + Quot<Self, Self>
|
||||
{ }
|
|
@ -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
|
||||
{ }
|
|
@ -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