pub trait AffineTransformation<E: EuclideanSpace>: ProjectiveTransformation<E> {
type Rotation: Rotation<E>;
type NonUniformScaling: AffineTransformation<E>;
type Translation: Translation<E>;
// Required methods
fn decompose(
&self,
) -> (Self::Translation, Self::Rotation, Self::NonUniformScaling, Self::Rotation);
fn append_translation(&self, t: &Self::Translation) -> Self;
fn prepend_translation(&self, t: &Self::Translation) -> Self;
fn append_rotation(&self, r: &Self::Rotation) -> Self;
fn prepend_rotation(&self, r: &Self::Rotation) -> Self;
fn append_scaling(&self, s: &Self::NonUniformScaling) -> Self;
fn prepend_scaling(&self, s: &Self::NonUniformScaling) -> Self;
// Provided method
fn append_rotation_wrt_point(
&self,
r: &Self::Rotation,
p: &E,
) -> Option<Self> { ... }
}Expand description
The group of affine transformations. They are decomposable into a rotation, a non-uniform scaling, a second rotation, and a translation (applied in that order).
Required Associated Types§
Sourcetype NonUniformScaling: AffineTransformation<E>
type NonUniformScaling: AffineTransformation<E>
Type of the non-uniform scaling to be applied.
Sourcetype Translation: Translation<E>
type Translation: Translation<E>
The type of the pure translation part of this affine transformation.
Required Methods§
Sourcefn decompose(
&self,
) -> (Self::Translation, Self::Rotation, Self::NonUniformScaling, Self::Rotation)
fn decompose( &self, ) -> (Self::Translation, Self::Rotation, Self::NonUniformScaling, Self::Rotation)
Decomposes this affine transformation into a rotation followed by a non-uniform scaling, followed by a rotation, followed by a translation.
Sourcefn append_translation(&self, t: &Self::Translation) -> Self
fn append_translation(&self, t: &Self::Translation) -> Self
Appends a translation to this similarity.
Sourcefn prepend_translation(&self, t: &Self::Translation) -> Self
fn prepend_translation(&self, t: &Self::Translation) -> Self
Prepends a translation to this similarity.
Sourcefn append_rotation(&self, r: &Self::Rotation) -> Self
fn append_rotation(&self, r: &Self::Rotation) -> Self
Appends a rotation to this similarity.
Sourcefn prepend_rotation(&self, r: &Self::Rotation) -> Self
fn prepend_rotation(&self, r: &Self::Rotation) -> Self
Prepends a rotation to this similarity.
Sourcefn append_scaling(&self, s: &Self::NonUniformScaling) -> Self
fn append_scaling(&self, s: &Self::NonUniformScaling) -> Self
Appends a scaling factor to this similarity.
Sourcefn prepend_scaling(&self, s: &Self::NonUniformScaling) -> Self
fn prepend_scaling(&self, s: &Self::NonUniformScaling) -> Self
Prepends a scaling factor to this similarity.
Provided Methods§
Sourcefn append_rotation_wrt_point(&self, r: &Self::Rotation, p: &E) -> Option<Self>
fn append_rotation_wrt_point(&self, r: &Self::Rotation, p: &E) -> Option<Self>
Appends to this similarity a rotation centered at the point p, i.e., this point is left
invariant.
May return None if Self does not have enough translational degree of liberty to perform
this computation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.