Safe Haskell | None |
---|
- class IsPoint2Functor g where
- class IsTransformable g where
- transformWith :: Num a => Matrix3 a -> g a -> g a
- class HasPoints g where
- newtype Vec3 a = Vec3 (a, a, a)
- newtype Matrix3 a = Matrix3 (Vec3 (Vec3 a))
- identityMatrix3 :: Num a => Matrix3 a
- matrix3FromLists :: [[a]] -> Matrix3 a
- matrix3FromList :: [a] -> Matrix3 a
- matrix3ToList :: Matrix3 a -> [a]
- matrix3ToLists :: Matrix3 a -> [[a]]
Point based geometries
class IsPoint2Functor g whereSource
Point based geometries
A class that defines a point2 functor. This defines that every operation that we can do on a point we can also do on instances of this class. i.e. by applying the operation on the underlying points.
class IsTransformable g whereSource
Class that indicates that something can be transformable using an affine transformation
transformWith :: Num a => Matrix3 a -> g a -> g aSource
IsPoint2Functor g => IsTransformable g | |
IsTransformable Point2' | Points are transformable |
Basic linear algebra to support affine transformations in 2D
Type to represent a matrix, form is: [ [ a11, a12, a13 ] [ a21, a22, a23 ] [ a31, a32, a33 ] ]
Vec3 (a, a, a) |
identityMatrix3 :: Num a => Matrix3 aSource
matrix3FromLists :: [[a]] -> Matrix3 aSource
Given a 3x3 matrix as a list of lists, convert it to a Matrix3
matrix3FromList :: [a] -> Matrix3 aSource
given a single list of 9 elements, construct a Matrix3
matrix3ToList :: Matrix3 a -> [a]Source
Gather the elements of the matrix in one long list (in row by row order)
matrix3ToLists :: Matrix3 a -> [[a]]Source