diff options
author | Joris Guyonvarch | 2015-03-05 22:55:06 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-05 22:55:11 +0100 |
commit | 716ce85464ee6d57a424a00d2535b3c2ce6ad9cb (patch) | |
tree | 01728db59af133a94855e536a25d6c5073bbfa38 /src/Vec2.elm | |
parent | 2fe50fd2ebb1815a330b20e599f756fa393de81b (diff) |
Adding a wave move
Diffstat (limited to 'src/Vec2.elm')
-rw-r--r-- | src/Vec2.elm | 9 |
1 files changed, 9 insertions, 0 deletions
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) |