Safe Haskell | Safe-Inferred |
---|
Compass bearings.
Documentation
Enumeration of compass bearings
bearing :: Pt R -> Pt R -> BearingSource
Bearing from Pt
p to q.
let f (x,y) = bearing (Pt 0 0) (Pt x y) map f [(0,1),(1,1),(1,0),(1,-1)] == [N,NE,E,SE] map f [(0,-1),(-1,-1),(-1,0),(-1,1)] == [S,SW,W,NW] map f [(1/4,1),(1,1/4),(1,-1/4),(1/4,-1)] == [NNE,ENE,ESE,SSE] map f [(-1/4,-1),(-1,-1/4),(-1,1.4),(-1/4,1)] == [SSW,WSW,NW,NNW]