From 716ce85464ee6d57a424a00d2535b3c2ce6ad9cb Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Thu, 5 Mar 2015 22:55:06 +0100 Subject: Adding a wave move --- src/Vec2.elm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Vec2.elm') diff --git a/src/Vec2.elm b/src/Vec2.elm index 056c657..c980e1a 100644 --- a/src/Vec2.elm +++ b/src/Vec2.elm @@ -29,6 +29,15 @@ div v 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) -- cgit v1.2.3