pub struct SimpleTransform<T> {
    pub mirror: bool,
    pub rotation: Angle,
    pub magnification: T,
    pub displacement: Vector<T>,
}
Expand description

Describes a geometric transformation that consists of a optional mirroring along the x-axis followed by a rotation by a multiple of 90 degrees followed by a displacement.

Fields

mirror: bool

Mirror on the x-axis?

rotation: Angle

Rotation by a multiple of 90 degrees.

magnification: T

Enlargement.

displacement: Vector<T>

Translation.

Implementations

Create a new transformation.

Get the identity transform.

Create a translation by a vector.

Create a rotation by an integer multiple of 90 degrees. Rotation center is (0, 0).

Create a rotation arount rotation_center by an integer multiple of 90 degrees.

Rotate 90 degrees counter-clock wise.

Rotate 90 degrees counter-clock wise.

Create a scaling by a factor.

Create a transformation that mirrors at the x-axis.

Create a transformation that mirrors at the y-axis.

Transform a distance.

Transform a single point.

Convert to a matrix transformation.

Return a new transformation that is equal to applying first self then t.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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

This method tests for !=.

Output type of the cast. This is likely the same geometrical type just with other coordinate types. Read more

Try to cast to target data type. Read more

Cast to target data type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.