- class Transform t where
- class Rotate t where
- class RotateAbout t where
- rotateAbout :: u ~ DUnit t => Radian -> Point2 u -> t -> t
- class Scale t where
- class Translate t where
- rotate30 :: Rotate t => t -> t
- rotate30About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> t
- rotate45 :: Rotate t => t -> t
- rotate45About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> t
- rotate60 :: Rotate t => t -> t
- rotate60About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> t
- rotate90 :: Rotate t => t -> t
- rotate90About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> t
- rotate120 :: Rotate t => t -> t
- rotate120About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> t
- uniformScale :: Scale t => Double -> t -> t
- reflectX :: Scale t => t -> t
- reflectY :: Scale t => t -> t
- translateBy :: (Translate t, DUnit t ~ u) => Vec2 u -> t -> t
- reflectXPlane :: (Num u, Scale t, Translate t, u ~ DUnit t) => Point2 u -> t -> t
- reflectYPlane :: (Num u, Scale t, Translate t, u ~ DUnit t) => Point2 u -> t -> t
Type classes
Apply a matrix transformation directly.
Type class for rotation.
class RotateAbout t whereSource
Type class for rotation about a point.
Note - the point is a DPoint2
- i.e. it has PostScript points
for x and y-units.
rotateAbout :: u ~ DUnit t => Radian -> Point2 u -> t -> tSource
RotateAbout Primitive | |
RotateAbout Picture | |
RotateAbout a => RotateAbout (Maybe a) | |
(Real u, Floating u) => RotateAbout (Point2 u) | |
(Real u, Floating u) => RotateAbout (Vec2 u) | |
(Real u, Floating u, Ord u) => RotateAbout (BoundingBox u) | |
(u ~ DUnit a, u ~ DUnit b, RotateAbout a, RotateAbout b) => RotateAbout (a, b) |
Type class for scaling.
Scale Primitive | |
Scale Picture | |
Scale a => Scale (Maybe a) | |
Fractional u => Scale (Point2 u) | |
Fractional u => Scale (Vec2 u) | |
(Fractional u, Ord u) => Scale (BoundingBox u) | |
(Scale a, Scale b) => Scale (a, b) |
Type class for translation.
Common rotations
rotate30About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource
Rotate by 30 degrees about the supplied point.
rotate45About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource
Rotate by 45 degrees about the supplied point.
rotate60About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource
Rotate by 60 degrees about the supplied point.
rotate90About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource
Rotate by 90 degrees about the supplied point.
rotate120About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource
Rotate by 120 degrees about the supplied point.
Common scalings
uniformScale :: Scale t => Double -> t -> tSource
Scale both x and y dimensions by the same amount.
Translate by a vector
translateBy :: (Translate t, DUnit t ~ u) => Vec2 u -> t -> tSource
Translate by the x and y components of a vector.