Skip to main content

Crate affine_rs

Crate affine_rs 

Source
Expand description

Two-dimensional affine transformations.

An Affine stores the six effective coefficients of the augmented matrix below. The final row is fixed and cannot be put into an invalid state.

| a  b  c |
| d  e  f |
| 0  0  1 |

§Example

use affine_rs::Affine;

let transform = Affine::translation(10.0, 20.0)
    .compose(Affine::scale(2.0, 2.0));
assert_eq!(transform.transform_point([3.0, 4.0]), [16.0, 28.0]);

Structs§

Affine
A two-dimensional affine transform.

Enums§

AffineError
Errors produced by affine operations.

Constants§

DEFAULT_EPSILON
Default tolerance for approximate comparisons.