Struct nalgebra::Similarity2 [] [src]

pub struct Similarity2<N> {
    pub isometry: Isometry2<N>,
    // some fields omitted
}

A two-dimensional similarity transformation.

This is a composition of a uniform scale, followed by a rotation, followed by a translation. Vectors Vector2 are not affected by the translational component of this transformation while points Point2 are. Similarity transformations conserve angles. Distances are multiplied by some constant (the scale factor). The scale factor cannot be zero.

Fields

isometry: Isometry2<N>

The isometry applicable by this similarity transformation.

Methods

impl<N: BaseFloat> Similarity2<N>
[src]

fn new(translation: Vector2<N>, rotation: Vector1<N>, scale: N) -> Similarity2<N>

Creates a new similarity transformation from a vector, an axis-angle rotation, and a scale factor.

The scale factor may be negative but not zero.

fn new_with_rotation_matrix(translation: Vector2<N>, rotation: Rotation2<N>, scale: N) -> Similarity2<N>

Creates a new similarity transformation from a rotation matrix, a vector, and a scale factor.

The scale factor may be negative but not zero.

fn new_with_isometry(isometry: Isometry2<N>, scale: N) -> Similarity2<N>

Creates a new similarity transformation from an isometry and a scale factor.

The scale factor may be negative but not zero.

impl<N: BaseFloat> Similarity2<N>
[src]

fn scale(&self) -> N

The scale factor of this similarity transformation.

fn inverse_scale(&self) -> N

The inverse scale factor of this similarity transformation.

fn append_scale_mut(&mut self, s: &N)

Appends in-place a scale to this similarity transformation.

fn append_scale(&self, s: &N) -> Similarity2<N>

Appends a scale to this similarity transformation.

fn prepend_scale_mut(&mut self, s: &N)

Prepends in-place a scale to this similarity transformation.

fn prepend_scale(&self, s: &N) -> Similarity2<N>

Prepends a scale to this similarity transformation.

fn set_scale(&mut self, s: N)

Sets the scale of this similarity transformation.

Trait Implementations

impl<N: Copy> Copy for Similarity2<N>
[src]

impl<N: Debug> Debug for Similarity2<N>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<N: Clone> Clone for Similarity2<N>
[src]

fn clone(&self) -> Similarity2<N>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<N: Decodable> Decodable for Similarity2<N>
[src]

fn decode<__DN: Decoder>(__arg_0: &mut __DN) -> Result<Similarity2<N>, __DN::Error>

impl<N: Encodable> Encodable for Similarity2<N>
[src]

fn encode<__SN: Encoder>(&self, __arg_0: &mut __SN) -> Result<(), __SN::Error>

impl<N: PartialEq> PartialEq for Similarity2<N>
[src]

fn eq(&self, __arg_0: &Similarity2<N>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Similarity2<N>) -> bool

This method tests for !=.

impl<N: Eq> Eq for Similarity2<N>
[src]

impl<N> Dimension for Similarity2<N>
[src]

fn dimension(_: Option<Similarity2<N>>) -> usize

The dimension of the object.

impl<N: BaseFloat> One for Similarity2<N>
[src]

fn one() -> Similarity2<N>

Returns the multiplicative identity element of Self, 1. Read more

impl<N: BaseFloat> Mul<Similarity2<N>> for Similarity2<N>
[src]

type Output = Similarity2<N>

The resulting type after applying the * operator

fn mul(self, right: Similarity2<N>) -> Similarity2<N>

The method for the * operator

impl<N: BaseFloat> MulAssign<Similarity2<N>> for Similarity2<N>
[src]

fn mul_assign(&mut self, right: Similarity2<N>)

The method for the *= operator

impl<N: BaseFloat> Mul<Isometry2<N>> for Similarity2<N>
[src]

type Output = Similarity2<N>

The resulting type after applying the * operator

fn mul(self, right: Isometry2<N>) -> Similarity2<N>

The method for the * operator

impl<N: BaseFloat> MulAssign<Isometry2<N>> for Similarity2<N>
[src]

fn mul_assign(&mut self, right: Isometry2<N>)

The method for the *= operator

impl<N: BaseFloat> Mul<Rotation2<N>> for Similarity2<N>
[src]

type Output = Similarity2<N>

The resulting type after applying the * operator

fn mul(self, right: Rotation2<N>) -> Similarity2<N>

The method for the * operator

impl<N: BaseFloat> MulAssign<Rotation2<N>> for Similarity2<N>
[src]

fn mul_assign(&mut self, right: Rotation2<N>)

The method for the *= operator

impl<N: BaseNum> Mul<Point2<N>> for Similarity2<N>
[src]

type Output = Point2<N>

The resulting type after applying the * operator

fn mul(self, right: Point2<N>) -> Point2<N>

The method for the * operator

impl<N: BaseNum> Mul<Vector2<N>> for Similarity2<N>
[src]

type Output = Vector2<N>

The resulting type after applying the * operator

fn mul(self, right: Vector2<N>) -> Vector2<N>

The method for the * operator

impl<N: BaseFloat> Transformation<Similarity2<N>> for Similarity2<N>
[src]

fn transformation(&self) -> Similarity2<N>

Gets the transformation of self.

fn inverse_transformation(&self) -> Similarity2<N>

Gets the inverse transformation of self.

fn append_transformation_mut(&mut self, t: &Similarity2<N>)

Appends a transformation to this object.

fn append_transformation(&self, t: &Similarity2<N>) -> Similarity2<N>

Appends the transformation amount to a copy of t.

fn prepend_transformation_mut(&mut self, t: &Similarity2<N>)

Prepends a transformation to this object.

fn prepend_transformation(&self, t: &Similarity2<N>) -> Similarity2<N>

Prepends the transformation amount to a copy of t.

fn set_transformation(&mut self, t: Similarity2<N>)

Sets the transformation of self.

impl<N: BaseNum> Transform<Point2<N>> for Similarity2<N>
[src]

fn transform(&self, p: &Point2<N>) -> Point2<N>

Applies a transformation to v.

fn inverse_transform(&self, p: &Point2<N>) -> Point2<N>

Applies an inverse transformation to v.

impl<N: BaseNum + Neg<Output=N>> Inverse for Similarity2<N>
[src]

fn inverse_mut(&mut self) -> bool

In-place version of inverse.

fn inverse(&self) -> Option<Similarity2<N>>

Returns the inverse of m.

impl<N: BaseNum> ToHomogeneous<Matrix3<N>> for Similarity2<N>
[src]

fn to_homogeneous(&self) -> Matrix3<N>

Gets the homogeneous coordinates form of this object.

impl<N: ApproxEq<N>> ApproxEq<N> for Similarity2<N>
[src]

fn approx_epsilon(_: Option<Similarity2<N>>) -> N

Default epsilon for approximation.

fn approx_ulps(_: Option<Similarity2<N>>) -> u32

Default ULPs for approximation.

fn approx_eq_eps(&self, other: &Similarity2<N>, epsilon: &N) -> bool

Tests approximate equality using a custom epsilon.

fn approx_eq_ulps(&self, other: &Similarity2<N>, ulps: u32) -> bool

Tests approximate equality using units in the last place (ULPs)

fn approx_eq(&self, other: &Self) -> bool

Tests approximate equality.

impl<N: Rand + BaseFloat> Rand for Similarity2<N>
[src]

fn rand<R: Rng>(rng: &mut R) -> Similarity2<N>

Generates a random instance of this type using the specified source of randomness. Read more

impl<N: Display + BaseFloat> Display for Similarity2<N>
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.