wumpus-basic-0.22.0: Basic objects and system code built on Wumpus-Core.

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Objects.Displacement

Contents

Description

Displacing points - often start points.

Synopsis

Displacement

type PointDisplace u = Point2 u -> Point2 uSource

PointDisplace is a type representing functions from Point to Point.

It is especially useful for building composite graphics where one part of the graphic is drawn from a different start point to the other part.

type ThetaPointDisplace u = Radian -> Point2 u -> Point2 uSource

ThetaPointDisplace is a type representing functions from Radian * Point to Point.

It is useful for building arrowheads which are constructed with an implicit angle representing the direction of the line at the arrow tip.

displace :: Num u => Vec2 u -> PointDisplace uSource

displace : Vec2 -> PointDisplace

Alias for .+^ from Data.AffineSpace.

dispParallel :: Floating u => u -> ThetaPointDisplace uSource

dispParallel : dist -> ThetaPointDisplace

Build a combinator to move Points in parallel to the direction of the implicit angle by the supplied distance dist.

dispPerpendicular :: Floating u => u -> ThetaPointDisplace uSource

dispParallel : dist -> ThetaPointDisplace

Build a combinator to move Points perpendicular to the inclnation of the implicit angle by the supplied distance dist.

dispOrtho :: Floating u => Vec2 u -> ThetaPointDisplace uSource

dispOrtho : vec -> ThetaPointDisplace

This is a combination of displaceParallel and displacePerpendicular, with the x component of the vector displaced in parallel and the y component displaced perpendicular.

dispDirectionTheta :: Floating u => Direction -> u -> ThetaPointDisplace uSource

Angular version of dispDirection.

The displacement direction is with respect to implicit angle of inclination, so:

 up    == perpendicular
 down  == perdendicular . negate
 left  == parallel . negate
 right == parallel

dispCardinalTheta :: Floating u => Cardinal -> u -> ThetaPointDisplace uSource

Angular version of dispCardinal.

The displacement direction is with respect to implicit angle of inclination, so:

 north == perpendicular
 east  == parallel
 south == perdendicular . negate
 etc.

Named vector constructors

go_up :: Num u => u -> Vec2 uSource

go_down :: Num u => u -> Vec2 uSource

go_left :: Num u => u -> Vec2 uSource

go_right :: Num u => u -> Vec2 uSource

go_north :: Num u => u -> Vec2 uSource

go_south :: Num u => u -> Vec2 uSource

go_east :: Num u => u -> Vec2 uSource

go_west :: Num u => u -> Vec2 uSource

go_up_left :: Num u => u -> Vec2 uSource

go_up_right :: Num u => u -> Vec2 uSource

go_down_left :: Num u => u -> Vec2 uSource

theta_left :: Floating u => u -> Radian -> Vec2 uSource

Parallel (reverse)

theta_right :: Floating u => u -> Radian -> Vec2 uSource

Parallel (forward)