wumpus-core-0.12.0: Pure Haskell PostScript and SVG generation.

PortabilityGHC only
Stabilityexperimental
Maintainerstephen.tetley@gmail.com

Wumpus.Core.AffineTrans

Contents

Description

Affine transformations

Synopsis

Type classes

class Rotate t whereSource

Methods

rotate :: Radian -> t -> tSource

Instances

(Floating a, Real a) => Rotate (Point2 a) 
(Floating a, Real a) => Rotate (Vec2 a) 
(Floating u, Real u) => Rotate (Picture u) 

class RotateAbout t whereSource

Methods

rotateAbout :: Radian -> Point2 (DUnit t) -> t -> tSource

Instances

class Scale t whereSource

Methods

scale :: DUnit t -> DUnit t -> t -> tSource

Instances

Num u => Scale (Point2 u) 
Num u => Scale (Vec2 u) 
(Num u, Ord u) => Scale (BoundingBox u) 
(Num u, Ord u) => Scale (Picture u) 

class Translate t whereSource

Methods

translate :: DUnit t -> DUnit t -> t -> tSource

Instances

Num u => Translate (Point2 u)

translate x y.

Num u => Translate (Vec2 u) 
(Num u, Ord u) => Translate (Picture u) 

Common rotations

rotate30 :: Rotate t => t -> tSource

rotate30About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource

rotate45 :: Rotate t => t -> tSource

rotate45About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource

rotate60 :: Rotate t => t -> tSource

rotate60About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource

rotate90 :: Rotate t => t -> tSource

rotate90About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource

rotate120 :: Rotate t => t -> tSource

rotate120About :: (RotateAbout t, DUnit t ~ u) => Point2 u -> t -> tSource

Common scalings

uniformScale :: (Scale t, DUnit t ~ u) => u -> t -> tSource

reflectX :: (Num u, Scale t, DUnit t ~ u) => t -> tSource

reflectY :: (Num u, Scale t, DUnit t ~ u) => t -> tSource

Translate by a vector

translateBy :: (Translate t, DUnit t ~ u) => Vec2 u -> t -> tSource

Reflections in supplied plane rather than about the origin

reflectXPlane :: (Num u, Scale t, Translate t, u ~ DUnit t) => Point2 u -> t -> tSource

Reflect in the X plane that intersects the supplied point.

reflectYPlane :: (Num u, Scale t, Translate t, u ~ DUnit t) => Point2 u -> t -> tSource

Reflect in the Y plane that intersects the supplied point.