Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

Contains the 2D transform matrix type and functions for composing transformation matricies.

# Types

Represents a transformation matrix that can be used to transform forms. This is more useful than just using the composing methods in the graphics API, as it can perform skewing and other complex transformation techniques.

# Composing

Construct an identity transformation matrix. Anything transformed by this matrix will remain the same.

matrix :: Double -> Double -> Double -> Double -> Double -> Double -> Transform Source

Construct a transformation matrix with specific row/column values.

matrix a b c d x y

/ a b x c d y /

rotation :: Double -> Transform Source

Construct a counter-clockwise rotating transformation matrix.

rotation t

/ cos t -sin t 0 sin t cos t 0 /

translation :: V2 Double -> Transform Source

Construct a translating transformation matrix.

translation (V2 x y)

/ 1 0 x 0 1 y /