Restructure files, add new subsystems

This commit is contained in:
2014-10-07 19:12:07 +02:00
parent 3ef3fb1621
commit b7d752ae20
7 changed files with 35 additions and 20 deletions

27
LinearAlgebra/Vector.hs Normal file
View File

@@ -0,0 +1,27 @@
{-# OPTIONS_HADDOCK ignore-exports #-}
module LinearAlgebra.Vector where
import Data.Vector.Class
type Angle = Double
-- |Checks whether the Coordinates are in a given dimension.
inRange :: (Double, Double) -- ^ X dimension
-> (Double, Double) -- ^ Y dimension
-> (Double, Double) -- ^ Coordinates
-> Bool -- ^ result
inRange (xlD, xuD) (ylD, yuD) (x,y)
= x <= xuD && x >= xlD && y <= yuD && y >= ylD
-- |Get the angle between two vectors in degrees.
getAngle :: (Vector v) => v -> v -> Angle
getAngle a b = (*) 180.0 .
flip (/) pi .
acos .
flip (/) (vmag a * vmag b) .
vdot a $
b