Struct nalgebra::Sim2 [] [src]

pub struct Sim2<N> {
    pub isometry: Iso2<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 Vec2 are not affected by the translational component of this transformation while points Pnt2 are. Similarity transformations conserve angles. Distances are multiplied by some constant (the scale factor). The scale factor cannot be zero.

Fields

isometry: Iso2<N>

The isometry applicable by this similarity transformation.

Methods

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

fn new(translation: Vec2<N>, rotation: Vec1<N>, scale: N) -> Sim2<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_rotmat(translation: Vec2<N>, rotation: Rot2<N>, scale: N) -> Sim2<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_iso(isometry: Iso2<N>, scale: N) -> Sim2<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> Sim2<N>
[src]

fn scale(&self) -> N

The scale factor of this similarity transformation.

fn inv_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) -> Sim2<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) -> Sim2<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 Sim2<N>
[src]

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

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

Formats the value using the given formatter.

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

fn clone(&self) -> Sim2<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 Sim2<N>
[src]

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

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

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

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

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

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

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

This method tests for !=.

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

impl<N> Dim for Sim2<N>
[src]

fn dim(_: Option<Sim2<N>>) -> usize

The dimension of the object.

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

fn one() -> Sim2<N>

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

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

type Output = Sim2<N>

The resulting type after applying the * operator

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

The method for the * operator

impl<N: BaseFloat> Mul<Iso2<N>> for Sim2<N>
[src]

type Output = Sim2<N>

The resulting type after applying the * operator

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

The method for the * operator

impl<N: BaseFloat> Mul<Rot2<N>> for Sim2<N>
[src]

type Output = Sim2<N>

The resulting type after applying the * operator

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

The method for the * operator

impl<N: BaseNum> Mul<Pnt2<N>> for Sim2<N>
[src]

type Output = Pnt2<N>

The resulting type after applying the * operator

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

The method for the * operator

impl<N: BaseNum> Mul<Vec2<N>> for Sim2<N>
[src]

type Output = Vec2<N>

The resulting type after applying the * operator

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

The method for the * operator

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

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

Gets the transformation of self.

fn inv_transformation(&self) -> Sim2<N>

Gets the inverse transformation of self.

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

Appends a transformation to this object.

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

Appends the transformation amount to a copy of t.

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

Prepends a transformation to this object.

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

Prepends the transformation amount to a copy of t.

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

Sets the transformation of self.

impl<N: BaseNum> Transform<Pnt2<N>> for Sim2<N>
[src]

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

Applies a transformation to v.

fn inv_transform(&self, p: &Pnt2<N>) -> Pnt2<N>

Applies an inverse transformation to v.

impl<N: BaseNum + Neg<Output=N>> Inv for Sim2<N>
[src]

fn inv_mut(&mut self) -> bool

In-place version of inverse.

fn inv(&self) -> Option<Sim2<N>>

Returns the inverse of m.

impl<N: BaseNum> ToHomogeneous<Mat3<N>> for Sim2<N>
[src]

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

Gets the homogeneous coordinates form of this object.

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

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

Default epsilon for approximation.

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

Default ULPs for approximation.

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

Tests approximate equality using a custom epsilon.

fn approx_eq_ulps(&self, other: &Sim2<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 Sim2<N>
[src]

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

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

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

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

Formats the value using the given formatter.