[−][src]Struct kurbo::Affine
A 2D affine transform.
Methods
impl Affine
[src]
pub fn new(c: [f64; 6]) -> Affine
[src]
Construct an affine transform from coefficients.
If the coefficients are (a, b, c, d, e, f)
, then the resulting
transformation represents this augmented matrix:
| a c e |
| b d f |
| 0 0 1 |
Note that this convention is transposed from PostScript and
Direct2D, but is consistent with the
Wikipedia
formulation of affine transformation as augmented matrix. The
idea is that (A * B) * v == A * (B * v)
, where *
is the
Mul
trait.
pub fn scale(s: f64) -> Affine
[src]
An affine transform representing uniform scaling.
pub fn rotate(th: f64) -> Affine
[src]
An affine transform representing rotation.
The convention for rotation is that a positive angle rotates a positive X direction into positive Y. Thus, in a Y-down coordinate system (as is common for graphics), it is a clockwise rotation, and in Y-up (traditional for math), it is anti-clockwise.
pub fn translate<V: Into<Vec2>>(p: V) -> Affine
[src]
An affine transform representing translation.
pub fn as_coeffs(self) -> [f64; 6]
[src]
Get the coefficients of the transform.
Trait Implementations
impl Default for Affine
[src]
impl Clone for Affine
[src]
fn clone(&self) -> Affine
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<Affine> for ColumnMatrix2x3<f64>
[src]
fn from(a: Affine) -> ColumnMatrix2x3<f64>
[src]
impl From<ColumnMatrix2x3<f64>> for Affine
[src]
fn from(m: ColumnMatrix2x3<f64>) -> Affine
[src]
impl Copy for Affine
[src]
impl Debug for Affine
[src]
impl Mul<Vec2> for Affine
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, other: Vec2) -> Vec2
[src]
impl Mul<Affine> for Affine
[src]
type Output = Affine
The resulting type after applying the *
operator.
fn mul(self, other: Affine) -> Affine
[src]
impl Mul<Affine> for f64
[src]
type Output = Affine
The resulting type after applying the *
operator.
fn mul(self, other: Affine) -> Affine
[src]
impl Mul<PathEl> for Affine
[src]
type Output = PathEl
The resulting type after applying the *
operator.
fn mul(self, other: PathEl) -> PathEl
[src]
impl Mul<BezPath> for Affine
[src]
type Output = BezPath
The resulting type after applying the *
operator.
fn mul(self, other: BezPath) -> BezPath
[src]
impl Mul<CubicBez> for Affine
[src]
type Output = CubicBez
The resulting type after applying the *
operator.
fn mul(self, c: CubicBez) -> CubicBez
[src]
impl Mul<Line> for Affine
[src]
type Output = Line
The resulting type after applying the *
operator.
fn mul(self, other: Line) -> Line
[src]
impl Mul<QuadBez> for Affine
[src]
type Output = QuadBez
The resulting type after applying the *
operator.
fn mul(self, other: QuadBez) -> QuadBez
[src]
impl MulAssign<Affine> for Affine
[src]
fn mul_assign(&mut self, other: Affine)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,