Struct Transform2
pub struct Transform2 { /* private fields */ }Expand description
A homogeneous 2D transform matrix.
Implementations§
§impl Transform2
impl Transform2
pub const fn new(matrix: [[f64; 3]; 3]) -> Transform2
pub const fn new(matrix: [[f64; 3]; 3]) -> Transform2
Creates a transform from a 3x3 homogeneous matrix.
pub const fn identity() -> Transform2
pub const fn identity() -> Transform2
Returns the identity transform.
pub const fn translation(translation: Translation) -> Transform2
pub const fn translation(translation: Translation) -> Transform2
Creates a 2D translation transform.
pub const fn scale(scale: Scale) -> Transform2
pub const fn scale(scale: Scale) -> Transform2
Creates a 2D scale transform.
pub fn rotation(rotation: Rotation) -> Transform2
pub fn rotation(rotation: Rotation) -> Transform2
Creates a 2D rotation transform.
pub fn apply_point(self, point: (f64, f64)) -> (f64, f64)
pub fn apply_point(self, point: (f64, f64)) -> (f64, f64)
Applies the transform to a 2D point tuple.
Trait Implementations§
§impl Clone for Transform2
impl Clone for Transform2
§fn clone(&self) -> Transform2
fn clone(&self) -> Transform2
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for Transform2
impl Debug for Transform2
§impl PartialEq for Transform2
impl PartialEq for Transform2
impl Copy for Transform2
impl StructuralPartialEq for Transform2
Auto Trait Implementations§
impl Freeze for Transform2
impl RefUnwindSafe for Transform2
impl Send for Transform2
impl Sync for Transform2
impl Unpin for Transform2
impl UnsafeUnpin for Transform2
impl UnwindSafe for Transform2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more