VEC: simplify scalarProd

This commit is contained in:
hasufell 2014-12-17 19:36:40 +01:00
parent d7366c7e27
commit e0ddeef9ed
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 1 additions and 4 deletions

View File

@ -64,10 +64,7 @@ vecLength v = sqrt (x^(2 :: Int) + y^(2 :: Int))
-- |Compute the scalar product of two vectors.
scalarProd :: Vec -> Vec -> Double
scalarProd v1 v2 = a1 * b1 + a2 * b2
where
(a1, a2) = unr2 v1
(b1, b2) = unr2 v2
scalarProd (R2 a1 a2) (R2 b1 b2) = a1 * b1 + a2 * b2
-- |Construct a vector that points to a point from the origin.