Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype Matrix n m r = Matrix (Vector n (Vector m r))
- multM :: (Arity r, Arity c, Arity c', Num a) => Matrix r c a -> Matrix c c' a -> Matrix r c' a
- mult :: (Arity m, Arity n, Num r) => Matrix n m r -> Vector m r -> Vector n r
- newtype Transformation d r = Transformation {
- _transformationMatrix :: Matrix (1 + d) (1 + d) r
- transformationMatrix :: Lens' (Transformation d r) (Matrix (1 + d) (1 + d) r)
- (|.|) :: (Num r, Arity (1 + d)) => Transformation d r -> Transformation d r -> Transformation d r
- class IsTransformable g where
- transformAllBy :: (Functor c, IsTransformable g) => Transformation (Dimension g) (NumType g) -> c g -> c g
- type AlwaysTruePFT d = AlwaysTrueDestruct d (1 + d)
- transformPointFunctor :: (PointFunctor g, Num r, d ~ Dimension (g r), AlwaysTruePFT d) => Transformation d r -> g r -> g r
- translation :: (Num r, Arity (1 + d), AlwaysTrueSnoc d, Arity d, Index' ((1 + d) - 1) (1 + d)) => Vector d r -> Transformation d r
- scaling :: (Num r, Arity (1 + d), AlwaysTrueSnoc d, Arity d) => Vector d r -> Transformation d r
- uniformScaling :: (Num r, Arity (1 + d), AlwaysTrueSnoc d, Arity d) => r -> Transformation d r
- type AlwaysTrueTransformation d = (Arity (1 + d), AlwaysTrueSnoc d, Arity d, Index' ((1 + d) - 1) (1 + d))
- translateBy :: (IsTransformable g, Num (NumType g), AlwaysTrueTransformation (Dimension g)) => Vector (Dimension g) (NumType g) -> g -> g
- scaleBy :: (IsTransformable g, Num (NumType g), AlwaysTrueTransformation (Dimension g)) => Vector (Dimension g) (NumType g) -> g -> g
- scaleUniformlyBy :: (IsTransformable g, Num (NumType g), AlwaysTrueTransformation (Dimension g)) => NumType g -> g -> g
- mkRow :: forall d r. (Arity d, Num r) => Int -> r -> Vector d r
- transRow :: forall n r. (Arity n, Index' (n - 1) n, Num r) => Int -> r -> Vector n r
Matrices
a matrix of n rows, each of m columns, storing values of type r
(Arity n, Arity m) => Functor (Matrix n m) Source # | |
(Eq r, Arity n, Arity m) => Eq (Matrix n m r) Source # | |
(Ord r, Arity n, Arity m) => Ord (Matrix n m r) Source # | |
(Show r, Arity n, Arity m) => Show (Matrix n m r) Source # | |
Coordinate r => IpeReadText (Matrix 3 3 r) Source # | |
IpeWriteText r => IpeWriteText (Matrix 3 3 r) Source # | |
multM :: (Arity r, Arity c, Arity c', Num a) => Matrix r c a -> Matrix c c' a -> Matrix r c' a Source #
Transformations
newtype Transformation d r Source #
A type representing a Transformation for d dimensional objects
Transformation | |
|
transformationMatrix :: Lens' (Transformation d r) (Matrix (1 + d) (1 + d) r) Source #
(|.|) :: (Num r, Arity (1 + d)) => Transformation d r -> Transformation d r -> Transformation d r Source #
Compose transformations (right to left)
Transformable geometry objects
class IsTransformable g where Source #
A class representing types that can be transformed using a transformation
transformBy :: Transformation (Dimension g) (NumType g) -> g -> g Source #
IsTransformable g => IsTransformable (Boundary g) Source # | |
Num r => IsTransformable (Image r) Source # | |
Num r => IsTransformable (IpeSymbol r) Source # | |
Num r => IsTransformable (MiniPage r) Source # | |
Num r => IsTransformable (TextLabel r) Source # | |
Num r => IsTransformable (PathSegment r) Source # | |
Num r => IsTransformable (Path r) Source # | |
Num r => IsTransformable (IpeObject r) Source # | |
Num r => IsTransformable (Group r) Source # | |
(Num r, Arity d, AlwaysTrueDestruct d ((+) 1 d)) => IsTransformable (Point d r) Source # | |
(Num r, AlwaysTruePFT d) => IsTransformable (HalfLine d r) Source # | |
Num r => IsTransformable (ConvexPolygon p r) Source # | |
Num r => IsTransformable (Triangle d r) Source # | |
(Num r, AlwaysTruePFT d) => IsTransformable (Box d p r) Source # | |
(Num r, AlwaysTruePFT d) => IsTransformable (LineSegment d p r) Source # | |
(Num r, AlwaysTruePFT d) => IsTransformable (PolyLine d p r) Source # | |
Num r => IsTransformable (Polygon t p r) Source # | |
transformAllBy :: (Functor c, IsTransformable g) => Transformation (Dimension g) (NumType g) -> c g -> c g Source #
type AlwaysTruePFT d = AlwaysTrueDestruct d (1 + d) Source #
transformPointFunctor :: (PointFunctor g, Num r, d ~ Dimension (g r), AlwaysTruePFT d) => Transformation d r -> g r -> g r Source #
Common transformations
translation :: (Num r, Arity (1 + d), AlwaysTrueSnoc d, Arity d, Index' ((1 + d) - 1) (1 + d)) => Vector d r -> Transformation d r Source #
scaling :: (Num r, Arity (1 + d), AlwaysTrueSnoc d, Arity d) => Vector d r -> Transformation d r Source #
uniformScaling :: (Num r, Arity (1 + d), AlwaysTrueSnoc d, Arity d) => r -> Transformation d r Source #
Functions that execute transformations
type AlwaysTrueTransformation d = (Arity (1 + d), AlwaysTrueSnoc d, Arity d, Index' ((1 + d) - 1) (1 + d)) Source #
translateBy :: (IsTransformable g, Num (NumType g), AlwaysTrueTransformation (Dimension g)) => Vector (Dimension g) (NumType g) -> g -> g Source #
scaleBy :: (IsTransformable g, Num (NumType g), AlwaysTrueTransformation (Dimension g)) => Vector (Dimension g) (NumType g) -> g -> g Source #
scaleUniformlyBy :: (IsTransformable g, Num (NumType g), AlwaysTrueTransformation (Dimension g)) => NumType g -> g -> g Source #