Struct libreda_db::prelude::Matrix3dTransform[][src]

pub struct Matrix3dTransform<T> where
    T: CoordinateType
{ pub m11: T, pub m12: T, pub m21: T, pub m22: T, pub m31: T, pub m32: T, }

Affine transformation represented as a 3x3 matrix like:

m11 m12 0
m21 m22 0
m31 m32 1

Fields

m11: T

m11

m12: T

m12

m21: T

m21

m22: T

m22

m31: T

m31. Used to express the x component of the translation.

m32: T

m32. Used to express the y component of the translation.

Implementations

impl<T> Matrix3dTransform<T> where
    T: CoordinateType
[src]

pub fn new(
    m11: T,
    m12: T,
    m21: T,
    m22: T,
    m31: T,
    m32: T
) -> Matrix3dTransform<T>
[src]

Create a new transform based on the matrix elements.

pub fn identity() -> Matrix3dTransform<T>[src]

Get the identity transform.

pub fn translate<V>(v: V) -> Matrix3dTransform<T> where
    V: Into<Vector<T>>, 
[src]

Create a translation by a vector.

pub fn rotate90(angle: Angle) -> Matrix3dTransform<T>[src]

Create a rotation by an integer multiple of 90 degrees.

pub fn scale(factor: T) -> Matrix3dTransform<T>[src]

Create a scaling by a factor.

pub fn mirror_x() -> Matrix3dTransform<T>[src]

Mirror at the x-axis.

pub fn mirror_y() -> Matrix3dTransform<T>[src]

Mirror at the y-axis.

pub fn transform_point(&self, p: Point<T>) -> Point<T>[src]

Apply the transformation to a single point.

pub fn to_matrix3d(&self) -> Matrix3d<T>[src]

Return the 3x3 matrix describing this transformation.

pub fn to_matrix2d(&self) -> Matrix2d<T>[src]

Return the 2x2 matrix that describes this transformation without any translation.

pub fn determinant(&self) -> T[src]

Compute the determinant of the 3x3 matrix that describes this transformation.

pub fn try_invert(&self) -> Option<Matrix3dTransform<T>>[src]

Get the inverse transformation if it exists.

pub fn then(&self, t: &Matrix3dTransform<T>) -> Matrix3dTransform<T>[src]

Return a new transformation that is equal to applying first self then t.

pub fn then_scale(&self, factor: T) -> Matrix3dTransform<T>[src]

Create a new transformation with an additional scaling.

pub fn then_translate<V>(&self, v: V) -> Matrix3dTransform<T> where
    V: Into<Vector<T>>, 
[src]

Create a new transformation with an additional translation.

pub fn then_rotate90(&self, angle: Angle) -> Matrix3dTransform<T>[src]

Create a new transformation with an additional rotation by a multiple of 90 degrees.

pub fn then_mirror_x(&self) -> Matrix3dTransform<T>[src]

Create a new transformation with an additional mirroring at the x-axis.

pub fn then_mirror_y(&self) -> Matrix3dTransform<T>[src]

Create a new transformation with an additional mirroring at the y-axis.

pub fn get_translation(&self) -> Vector<T>[src]

Get the translation part of this affine transformation.

impl<T> Matrix3dTransform<T> where
    T: CoordinateType + Float
[src]

pub fn rotation(phi: T) -> Matrix3dTransform<T>[src]

Create a rotation by an arbitrary angle (in radians).

pub fn then_rotate(&self, phi: T) -> Matrix3dTransform<T>[src]

Create a new transformation with an additional rotation.

Trait Implementations

impl<T> Clone for Matrix3dTransform<T> where
    T: CoordinateType + Clone
[src]

impl<T> Debug for Matrix3dTransform<T> where
    T: CoordinateType + Debug
[src]

impl<T> Eq for Matrix3dTransform<T> where
    T: CoordinateType + Eq
[src]

impl<T> Hash for Matrix3dTransform<T> where
    T: CoordinateType + Hash
[src]

impl<T> Mul<Matrix3dTransform<T>> for Matrix3dTransform<T> where
    T: CoordinateType
[src]

type Output = Matrix3dTransform<T>

The resulting type after applying the * operator.

pub fn mul(
    self,
    rhs: Matrix3dTransform<T>
) -> <Matrix3dTransform<T> as Mul<Matrix3dTransform<T>>>::Output
[src]

Shortcut for self.then(&rhs).

impl<T> PartialEq<Matrix3dTransform<T>> for Matrix3dTransform<T> where
    T: CoordinateType + PartialEq<T>, 
[src]

impl<T> StructuralEq for Matrix3dTransform<T> where
    T: CoordinateType
[src]

impl<T> StructuralPartialEq for Matrix3dTransform<T> where
    T: CoordinateType
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Matrix3dTransform<T> where
    T: RefUnwindSafe

impl<T> Send for Matrix3dTransform<T> where
    T: Send

impl<T> Sync for Matrix3dTransform<T> where
    T: Sync

impl<T> Unpin for Matrix3dTransform<T> where
    T: Unpin

impl<T> UnwindSafe for Matrix3dTransform<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> TextType for T where
    T: Clone + Eq + Debug + Hash
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.