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

Portability GHC highly unstable stephen.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`.

`dispParallel` : ` dist -> ThetaPointDisplace `

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

`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.

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
```

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 vectors

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