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

Wumpus.Core.AffineTrans

Contents

Synopsis

Type classes

class Transform t whereSource

Apply a matrix transformation directly.

Methods

transform :: u ~ DUnit t => Matrix3'3 u -> t -> tSource

Instances

Transform Picture 
Transform a => Transform (Maybe a) 
Num u => Transform (Point2 u) 
Num u => Transform (Vec2 u) 
(Num u, Ord u) => Transform (BoundingBox u) 
(u ~ DUnit a, u ~ DUnit b, Transform a, Transform b) => Transform (a, b) 

class Rotate t whereSource

Type class for rotation.

Methods

rotate :: Radian -> t -> tSource

Instances

Rotate Primitive 
Rotate Picture 
Rotate a => Rotate (Maybe a) 
(Real u, Floating u) => Rotate (Point2 u) 
(Real u, Floating u) => Rotate (Vec2 u) 
(Real u, Floating u, Ord u) => Rotate (BoundingBox u) 
(Rotate a, Rotate b) => Rotate (a, b) 

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.

Methods

rotateAbout :: u ~ DUnit t => Radian -> Point2 u -> t -> tSource

class Scale t whereSource

Type class for scaling.

Methods

scale :: Double -> Double -> t -> tSource

Instances

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) 

class Translate t whereSource

Type class for translation.

Methods

translate :: u ~ DUnit t => u -> u -> t -> tSource

Instances

Translate Primitive 
Translate Picture 
Translate a => Translate (Maybe a) 
Num u => Translate (Point2 u) 
Translate (Vec2 u)

Vectors do not respond to translation.

(Num u, Ord u) => Translate (BoundingBox u) 
(u ~ DUnit a, u ~ DUnit b, Translate a, Translate b) => Translate (a, b) 

Common rotations

rotate30 :: Rotate t => t -> tSource

Rotate by 30 degrees about the origin.

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

Rotate by 30 degrees about the supplied point.

rotate45 :: Rotate t => t -> tSource

Rotate by 45 degrees about the origin.

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

Rotate by 45 degrees about the supplied point.

rotate60 :: Rotate t => t -> tSource

Rotate by 60 degrees about the origin.

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

Rotate by 60 degrees about the supplied point.

rotate90 :: Rotate t => t -> tSource

Rotate by 90 degrees about the origin.

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

Rotate by 90 degrees about the supplied point.

rotate120 :: Rotate t => t -> tSource

Rotate by 120 degrees about the origin.

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.

reflectX :: Scale t => t -> tSource

Reflect in the X-plane about the origin.

reflectY :: Scale t => t -> tSource

Reflect in the Y-plane about the origin.

Translate by a vector

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

Translate by the x and y components of a vector.

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.