diff options
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 |