aboutsummaryrefslogtreecommitdiff
path: root/src/Geometry.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-07 15:12:02 +0100
committerJoris Guyonvarch2015-03-07 15:12:02 +0100
commit17a58e0c4c67f27d87635bf1b2ca50fb11795ad3 (patch)
tree8de99cdf0b4021ca6db6920537e7d0fa250e90bc /src/Geometry.elm
parent336816d2e8ab4afff1562123dfde61bf3a68e61c (diff)
downloadcatchvoid-17a58e0c4c67f27d87635bf1b2ca50fb11795ad3.tar.gz
catchvoid-17a58e0c4c67f27d87635bf1b2ca50fb11795ad3.tar.bz2
catchvoid-17a58e0c4c67f27d87635bf1b2ca50fb11795ad3.zip
Organizing source code with subdirectories
Diffstat (limited to 'src/Geometry.elm')
-rw-r--r--src/Geometry.elm23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/Geometry.elm b/src/Geometry.elm
deleted file mode 100644
index 73e8d1f..0000000
--- a/src/Geometry.elm
+++ /dev/null
@@ -1,23 +0,0 @@
-module Geometry where
-
-import Vec2 (..)
-import Board (boardSize)
-
-polarToCartesian : Float -> Float -> Vec2
-polarToCartesian angle dist =
- { x = dist * (cos angle)
- , y = dist * (sin angle)
- }
-
-distance : Vec2 -> Vec2 -> Float
-distance v1 v2 = sqrt((v2.x - v1.x)^2 + (v2.y - v1.y)^2)
-
-inBoard : Float -> Vec2 -> Vec2
-inBoard size pos =
- let leftX = -boardSize.x / 2 + size
- rightX = boardSize.x / 2 - size
- bottomY = -boardSize.y / 2 + size
- topY = boardSize.y / 2 - size
- in { x = clamp leftX rightX pos.x
- , y = clamp bottomY topY pos.y
- }