From 17a58e0c4c67f27d87635bf1b2ca50fb11795ad3 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 7 Mar 2015 15:12:02 +0100 Subject: Organizing source code with subdirectories --- src/Vec2.elm | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/Vec2.elm (limited to 'src/Vec2.elm') diff --git a/src/Vec2.elm b/src/Vec2.elm deleted file mode 100644 index c980e1a..0000000 --- a/src/Vec2.elm +++ /dev/null @@ -1,45 +0,0 @@ -module Vec2 where - -type alias Vec2 = - { x : Float - , y : Float - } - -add : Vec2 -> Vec2 -> Vec2 -add v1 v2 = - { x = v1.x + v2.x - , y = v1.y + v2.y - } - -sub : Vec2 -> Vec2 -> Vec2 -sub v1 v2 = - { x = v1.x - v2.x - , y = v1.y - v2.y - } - -mul : Float -> Vec2 -> Vec2 -mul m v = - { x = m * v.x - , y = m * v.y - } - -div : Vec2 -> Float -> Vec2 -div v d = - { x = v.x / d - , y = v.y / d - } - -norm : Vec2 -> Float -norm v = sqrt(v.x ^ 2 + v.y ^ 2) - -clockwiseRotate90 : Vec2 -> Vec2 -clockwiseRotate90 v = - { x = -v.y - , y = v.x - } - -isNull : Vec2 -> Bool -isNull v = (v.x == 0) && (v.y == 0) - -originVec : Vec2 -originVec = { x = 0, y = 0 } -- cgit v1.2.3