@@ -1,19 +1,21 @@
11
2−module Matrix2D where
2+module Transform2D where
33
4−import Native.Matrix2D
4+import Native.Transform2D
55
6−data Matrix2D = Matrix2D
6+data Transform2D = Transform2D
77
8−-- Create an identity matrix.
8+-- Create an identity transform. Transforming by the identity does
9+-- not change anything, but it can come in handy as a default or
10+-- base case.
911--
1012-- / 1 0 \\
1113-- \\ 0 1 /
12−identity : Matrix2D
13−identity = Native.Matrix2D.identity
14+identity : Transform2D
15+identity = Native.Transform2D.identity
1416
15−-- Creates an arbitrary matrix. This lets you create scales, shears, reflections,
16−-- translations, or any other 2D transform.
17+-- Creates an arbitrary transformation matrix. This lets you create scales,
18+-- shears, reflections, translations, or any other 2D transform.
1719--
1820-- matrix a b c d dx dy
1921--
@@ -21,22 +23,22 @@ identity = Native.Matrix2D.identity
2123-- \\ c d /
2224--
2325-- And `dx` and `dy` are the translation values.
24−matrix : Float -> Float -> Float -> Float -> Float -> Float -> Matrix2D
25−matrix = Native.Matrix2D.matrix
26+matrix : Float -> Float -> Float -> Float -> Float -> Float -> Transform2D
27+matrix = Native.Transform2D.matrix
2628
2729-- Creates a [rotation matrix](http://en.wikipedia.org/wiki/Rotation_matrix).
2830-- Given an angle t, it creates a counterclockwise rotation matrix:
2931--
3032-- / cos t -sin t \\
3133-- \\ sin t cos t /
32−rotation : Float -> Matrix2D
33−rotation = Native.Matrix2D.rotation
34+rotation : Float -> Transform2D
35+rotation = Native.Transform2D.rotation
3436
35−-- Multiplies two matrices together:
37+-- Multiplies two transforms together:
3638--
3739-- multiply a b
3840--
3941-- / a11 a12 \\ . / b11 b12 \\
4042-- \\ a21 a22 / \\ b21 b22 /
41−multiply : Matrix2D -> Matrix2D -> Matrix2D
42−multiply = Native.Matrix2D.multiply
43+multiply : Transform2D -> Transform2D -> Transform2D
44+multiply = Native.Transform2D.multiply