diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-26 23:41:53 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-26 23:41:53 +0200 |
commit | cfa9cf94568fbe1564e5b4e386a8170910bc552e (patch) | |
tree | 4775bfc3d4436431af43fc9fd45792f5cbf1f0b6 /src/Vector.hs | |
parent | ae4a69415050b61f4488255dad0b1c3d045e6de5 (diff) | |
download | htanks-master.tar htanks-master.zip |
Diffstat (limited to 'src/Vector.hs')
-rw-r--r-- | src/Vector.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Vector.hs b/src/Vector.hs index 174afd3..749693e 100644 --- a/src/Vector.hs +++ b/src/Vector.hs @@ -81,11 +81,11 @@ toAngle (Rotation c s) = atan2 s c fromAngle :: Coord -> Rotation fromAngle a = Rotation (cos a) (sin a) -toVector :: Rotation -> Vector -toVector (Rotation c s) = Vector c s +toVector :: Coord -> Rotation -> Vector +toVector l (Rotation c s) = l *^ Vector c s -fromVector :: Vector -> Rotation -fromVector v = Rotation x y +fromVector :: Vector -> (Rotation, Coord) +fromVector v = (Rotation x y, magnitude v) where Vector x y = normalized v |