[−][src]Struct pointy::Transform64
An affine transform for Pt64 values.
A series of translate, rotate, scale and skew transformations can be
combined into a single Transform64
.
Example
use pointy::{Pt64, Transform64}; let t = Transform64::with_translate(-50.0, -50.0) .rotate(std::f64::consts::PI) .translate(50.0, 50.0) .scale(2.0, 2.0); let pt = Pt64(13.0, 5.5) * t;
Implementations
impl Transform64
[src]
pub const fn with_translate(tx: f64, ty: f64) -> Self
[src]
Create a new translation transform.
tx
Amount to translate X.ty
Amount to translate Y.
pub const fn with_scale(sx: f64, sy: f64) -> Self
[src]
Create a new scale transform.
sx
Scale factor for X dimension.sy
Scale factor for Y dimension.
pub fn with_rotate(th: f64) -> Self
[src]
Create a new rotation transform.
th
Angle to rotate coordinates (radians).
pub fn with_skew(ax: f64, ay: f64) -> Self
[src]
Create a new skew transform.
ax
Angle to skew X-axis (radians).ay
Angle to skew Y-axis (radians).
pub fn translate(self, tx: f64, ty: f64) -> Self
[src]
Apply translation to a transform.
tx
Amount to translate X.ty
Amount to translate Y.
pub fn scale(self, sx: f64, sy: f64) -> Self
[src]
Apply scaling to a transform.
sx
Scale factor for X dimension.sy
Scale factor for Y dimension.
pub fn rotate(self, th: f64) -> Self
[src]
Apply rotation to a transform.
th
Angle to rotate coordinates (radians).
pub fn skew(self, ax: f64, ay: f64) -> Self
[src]
Apply skew to a transform.
ax
Angle to skew X-axis (radians).ay
Angle to skew Y-axis (radians).
Trait Implementations
impl Clone for Transform64
[src]
fn clone(&self) -> Transform64
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Transform64
[src]
impl Debug for Transform64
[src]
impl Default for Transform64
[src]
impl Mul<(f64, f64)> for Transform64
[src]
type Output = Pt64
The resulting type after applying the *
operator.
fn mul(self, s: (f64, f64)) -> Pt64
[src]
impl Mul<Pt64> for Transform64
[src]
type Output = Pt64
The resulting type after applying the *
operator.
fn mul(self, s: Pt64) -> Pt64
[src]
impl Mul<Transform64> for Transform64
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
impl Mul<Transform64> for Pt64
[src]
type Output = Pt64
The resulting type after applying the *
operator.
fn mul(self, t: Transform64) -> Pt64
[src]
impl Mul<Transform64> for (f64, f64)
[src]
type Output = Pt64
The resulting type after applying the *
operator.
fn mul(self, t: Transform64) -> Pt64
[src]
impl MulAssign<Transform64> for Transform64
[src]
fn mul_assign(&mut self, rhs: Self)
[src]
impl PartialEq<Transform64> for Transform64
[src]
fn eq(&self, other: &Transform64) -> bool
[src]
fn ne(&self, other: &Transform64) -> bool
[src]
impl StructuralPartialEq for Transform64
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transform64
impl Send for Transform64
impl Sync for Transform64
impl Unpin for Transform64
impl UnwindSafe for Transform64
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,