pub struct Matrix {
pub a: f64,
pub b: f64,
pub c: f64,
pub d: f64,
pub e: f64,
pub f: f64,
}Expand description
an affine matrix as PDF writes it (a b c d e f cm): x’ = a x + c y + e, y’ = b x + d y + f
Fields§
§a: f64§b: f64§c: f64§d: f64§e: f64§f: f64Implementations§
Source§impl Matrix
impl Matrix
pub const IDENTITY: Matrix
pub const fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Matrix
pub const fn translate(tx: f64, ty: f64) -> Matrix
pub const fn scale(sx: f64, sy: f64) -> Matrix
Sourcepub fn rotate(angle: f64) -> Matrix
pub fn rotate(angle: f64) -> Matrix
a rotation by angle radians: counter-clockwise where y points up, clockwise on a canvas
whose y points down
pub fn apply(&self, x: f64, y: f64) -> (f64, f64)
pub fn det(&self) -> f64
Trait Implementations§
impl Copy for Matrix
Source§impl From<Matrix> for Matrix
gfx’s matrix (x’ = a x + b y + c, y’ = d x + e y + f) as PDF writes it
impl From<Matrix> for Matrix
gfx’s matrix (x’ = a x + b y + c, y’ = d x + e y + f) as PDF writes it
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Forget for Matrix
impl Freeze for Matrix
impl Move for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnsafeUnpin for Matrix
impl UnwindSafe for Matrix
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