Struct footile::Transform [] [src]

pub struct Transform { /* fields omitted */ }

An affine transform can translate, scale, rotate and skew 2D points.

A series of transforms can be combined into a single Transform struct. This can be used by a Plotter to alter subsequent points.

Example

use footile::Transform;
const PI: f32 = std::f32::consts::PI;
let t = Transform::new_translate(-50f32, -50f32)
                  .rotate(PI)
                  .translate(50f32, 50f32)
                  .scale(2f32, 2f32);

Methods

impl Transform
[src]

[src]

Create a new identity transform.

[src]

Create a new translation transform.

  • tx Amount to translate X.
  • ty Amount to translate Y.

[src]

Create a new scale transform.

  • sx Scale factor for X dimension.
  • sy Scale factor for Y dimension.

[src]

Create a new rotation transform.

  • th Angle to rotate coordinates (radians).

[src]

Create a new skew transform.

  • ax Angle to skew X-axis (radians).
  • ay Angle to skew Y-axis (radians).

[src]

Apply translation to a transform.

  • tx Amount to translate X.
  • ty Amount to translate Y.

[src]

Apply scaling to a transform.

  • sx Scale factor for X dimension.
  • sy Scale factor for Y dimension.

[src]

Apply rotation to a transform.

  • th Angle to rotate coordinates (radians).

[src]

Apply skew to a transform.

  • ax Angle to skew X-axis (radians).
  • ay Angle to skew Y-axis (radians).

Trait Implementations

impl Clone for Transform
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Transform
[src]

impl Debug for Transform
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Transform
[src]

[src]

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

[src]

This method tests for !=.

impl MulAssign for Transform
[src]

[src]

Performs the *= operation.

impl Mul for Transform
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vec2> for Transform
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.