VEC: move scalarMul from Test/Vector.hs to Algebra/Vector.hs

This commit is contained in:
2014-12-17 19:41:15 +01:00
parent 35e1366034
commit 38329a806b
2 changed files with 5 additions and 2 deletions

View File

@@ -67,6 +67,11 @@ scalarProd :: Vec -> Vec -> Double
scalarProd (R2 a1 a2) (R2 b1 b2) = a1 * b1 + a2 * b2
-- |Multiply a scalar with a vector.
scalarMul :: Double -> Vec -> Vec
scalarMul d (R2 a b) = R2 (a * d) (b * d)
-- |Construct a vector that points to a point from the origin.
pt2Vec :: PT -> Vec
pt2Vec = r2 . unp2