Struct libreda_db::prelude::Matrix3dTransform [−][src]
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]
T: CoordinateType,
pub fn new(
m11: T,
m12: T,
m21: T,
m22: T,
m31: T,
m32: T
) -> Matrix3dTransform<T>
[src]
m11: T,
m12: T,
m21: T,
m22: T,
m31: T,
m32: T
) -> Matrix3dTransform<T>
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]
V: Into<Vector<T>>,
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]
V: Into<Vector<T>>,
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]
T: CoordinateType + Float,
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]
T: CoordinateType + Clone,
pub fn clone(&self) -> Matrix3dTransform<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for Matrix3dTransform<T> where
T: CoordinateType + Debug,
[src]
T: CoordinateType + Debug,
impl<T> Eq for Matrix3dTransform<T> where
T: CoordinateType + Eq,
[src]
T: CoordinateType + Eq,
impl<T> Hash for Matrix3dTransform<T> where
T: CoordinateType + Hash,
[src]
T: CoordinateType + Hash,
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> Mul<Matrix3dTransform<T>> for Matrix3dTransform<T> where
T: CoordinateType,
[src]
T: CoordinateType,
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]
self,
rhs: Matrix3dTransform<T>
) -> <Matrix3dTransform<T> as Mul<Matrix3dTransform<T>>>::Output
Shortcut for self.then(&rhs)
.
impl<T> PartialEq<Matrix3dTransform<T>> for Matrix3dTransform<T> where
T: CoordinateType + PartialEq<T>,
[src]
T: CoordinateType + PartialEq<T>,
pub fn eq(&self, other: &Matrix3dTransform<T>) -> bool
[src]
pub fn ne(&self, other: &Matrix3dTransform<T>) -> bool
[src]
impl<T> StructuralEq for Matrix3dTransform<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> StructuralPartialEq for Matrix3dTransform<T> where
T: CoordinateType,
[src]
T: CoordinateType,
Auto Trait Implementations
impl<T> RefUnwindSafe for Matrix3dTransform<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Matrix3dTransform<T> where
T: Send,
T: Send,
impl<T> Sync for Matrix3dTransform<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Matrix3dTransform<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Matrix3dTransform<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> TextType for T where
T: Clone + Eq + Debug + Hash,
[src]
T: Clone + Eq + Debug + Hash,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,