Add 8-way cardinal/intercardinal datatype

This commit is contained in:
2024-10-18 12:39:46 +01:00
parent d256bc0443
commit 8b6f5529ff
12 changed files with 267 additions and 157 deletions
+11
View File
@@ -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