pub struct Similarity2 { /* private fields */ }Expand description
A 2D affine transform whose linear part is a nonsingular similarity.
Implementations§
Source§impl Similarity2
impl Similarity2
Sourcepub fn try_from_f64_affine(
a: f64,
b: f64,
d: f64,
e: f64,
xoff: f64,
yoff: f64,
tolerance: f64,
) -> CurveResult<Self>
pub fn try_from_f64_affine( a: f64, b: f64, d: f64, e: f64, xoff: f64, yoff: f64, tolerance: f64, ) -> CurveResult<Self>
Constructs a planar similarity from finite affine entries.
The transform is:
x' = a*x + b*y + xoff
y' = d*x + e*y + yoffThe finite validation tolerance is only used to accept API-boundary matrix entries as a similarity. Once accepted, all transformed geometry is built with hyperreal coefficients.
Sourcepub const fn reverses_orientation(&self) -> bool
pub const fn reverses_orientation(&self) -> bool
Returns true when the transform reverses orientation.
Sourcepub fn transform_point(&self, point: &Point2) -> Point2
pub fn transform_point(&self, point: &Point2) -> Point2
Transforms a point with hyperreal arithmetic.
Trait Implementations§
Source§impl Clone for Similarity2
impl Clone for Similarity2
Source§fn clone(&self) -> Similarity2
fn clone(&self) -> Similarity2
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Similarity2
impl Debug for Similarity2
Source§impl PartialEq for Similarity2
impl PartialEq for Similarity2
Source§fn eq(&self, other: &Similarity2) -> bool
fn eq(&self, other: &Similarity2) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Similarity2
Auto Trait Implementations§
impl !Freeze for Similarity2
impl !RefUnwindSafe for Similarity2
impl !Sync for Similarity2
impl Send for Similarity2
impl Unpin for Similarity2
impl UnsafeUnpin for Similarity2
impl UnwindSafe for Similarity2
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