pub struct Affine(pub [f64; 6]);Expand description
2D affine [a, b, c, d, e, f]: x’ = a x + c y + e, y’ = b x + d y + f.
Tuple Fields§
§0: [f64; 6]Implementations§
Source§impl Affine
impl Affine
pub const IDENTITY: Affine
pub fn translate(x: f64, y: f64) -> Affine
pub fn scale(x: f64, y: f64) -> Affine
pub fn rotate(r: f64) -> Affine
pub fn skew_x(r: f64) -> Affine
pub fn mul(self, o: Affine) -> Affine
pub fn det(self) -> f64
pub fn inverse(self) -> Option<Affine>
pub fn apply(self, x: f64, y: f64) -> (f64, f64)
Trait Implementations§
impl Copy for Affine
impl StructuralPartialEq for Affine
Auto Trait Implementations§
impl Forget for Affine
impl Freeze for Affine
impl Move for Affine
impl RefUnwindSafe for Affine
impl Send for Affine
impl Sync for Affine
impl Unpin for Affine
impl UnsafeUnpin for Affine
impl UnwindSafe for Affine
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