Add 8-way cardinal/intercardinal datatype
This commit is contained in:
@@ -12,3 +12,14 @@ cardVec cp = case cp of
|
||||
South -> V2 0 (-1)
|
||||
East -> V2 1 0
|
||||
West -> V2 (-1) 0
|
||||
|
||||
cardEightVec :: CardinalEightPoint -> Point2
|
||||
cardEightVec cp = case cp of
|
||||
North8 -> V2 0 1
|
||||
NorthEast8 -> V2 1 1
|
||||
East8 -> V2 1 0
|
||||
SouthEast8 -> V2 1 (-1)
|
||||
South8 -> V2 0 (-1)
|
||||
SouthWest8 -> V2 (-1) (-1)
|
||||
West8 -> V2 (-1) 0
|
||||
NorthWest8 -> V2 (-1) 1
|
||||
|
||||
Reference in New Issue
Block a user