[go: up one dir, main page]

Trait Similarity

Source
pub trait Similarity<E: EuclideanSpace>: AffineTransformation<E, NonUniformScaling = Self::Scaling> {
    type Scaling: Scaling<E>;

Show 13 methods // Required methods fn translation(&self) -> Self::Translation; fn rotation(&self) -> Self::Rotation; fn scaling(&self) -> Self::Scaling; // Provided methods fn translate_point(&self, pt: &E) -> E { ... } fn rotate_point(&self, pt: &E) -> E { ... } fn scale_point(&self, pt: &E) -> E { ... } fn rotate_vector(&self, pt: &E::Coordinates) -> E::Coordinates { ... } fn scale_vector(&self, pt: &E::Coordinates) -> E::Coordinates { ... } fn inverse_translate_point(&self, pt: &E) -> E { ... } fn inverse_rotate_point(&self, pt: &E) -> E { ... } fn inverse_scale_point(&self, pt: &E) -> E { ... } fn inverse_rotate_vector(&self, pt: &E::Coordinates) -> E::Coordinates { ... } fn inverse_scale_vector(&self, pt: &E::Coordinates) -> E::Coordinates { ... }
}
Expand description

Subgroups of the similarity group S(n), i.e., rotations, translations, and (signed) uniform scaling.

Similarities map lines to lines and preserve angles.

Required Associated Types§

Source

type Scaling: Scaling<E>

The type of the pure (uniform) scaling part of this similarity transformation.

Required Methods§

Source

fn translation(&self) -> Self::Translation

The pure translational component of this similarity transformation.

Source

fn rotation(&self) -> Self::Rotation

The pure rotational component of this similarity transformation.

Source

fn scaling(&self) -> Self::Scaling

The pure scaling component of this similarity transformation.

Provided Methods§

Source

fn translate_point(&self, pt: &E) -> E

Applies this transformation’s pure translational part to a point.

Source

fn rotate_point(&self, pt: &E) -> E

Applies this transformation’s pure rotational part to a point.

Source

fn scale_point(&self, pt: &E) -> E

Applies this transformation’s pure scaling part to a point.

Source

fn rotate_vector(&self, pt: &E::Coordinates) -> E::Coordinates

Applies this transformation’s pure rotational part to a vector.

Source

fn scale_vector(&self, pt: &E::Coordinates) -> E::Coordinates

Applies this transformation’s pure scaling part to a vector.

Source

fn inverse_translate_point(&self, pt: &E) -> E

Applies this transformation inverse’s pure translational part to a point.

Source

fn inverse_rotate_point(&self, pt: &E) -> E

Applies this transformation inverse’s pure rotational part to a point.

Source

fn inverse_scale_point(&self, pt: &E) -> E

Applies this transformation inverse’s pure scaling part to a point.

Source

fn inverse_rotate_vector(&self, pt: &E::Coordinates) -> E::Coordinates

Applies this transformation inverse’s pure rotational part to a vector.

Source

fn inverse_scale_vector(&self, pt: &E::Coordinates) -> E::Coordinates

Applies this transformation inverse’s pure scaling part to a vector.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<E: EuclideanSpace> Similarity<E> for Id

Source§

impl<R, E> Similarity<E> for R
where R: RealField + SubsetOf<R>, E: EuclideanSpace<RealField = R>, E::Coordinates: ClosedMul<R> + ClosedDiv<R> + ClosedNeg,