From 3727ae620f94071db48f38a73d3227cca2c02cce Mon Sep 17 00:00:00 2001 From: hasufell Date: Wed, 17 Dec 2014 23:21:48 +0100 Subject: [PATCH] TESTS: add getAngleProp7 --- Test/Vector.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Test/Vector.hs b/Test/Vector.hs index 5a291cf..41bcb50 100644 --- a/Test/Vector.hs +++ b/Test/Vector.hs @@ -142,6 +142,13 @@ getAngleProp6 (Positive v1) (Positive v2) = getAngle v1 v2 == getAngle v2 v1 +-- Angle between two identical vectors. We can't check against 0 +-- because of sqrt in vecLength. +getAngleProp7 :: PosRoundR2 -> Bool +getAngleProp7 (PosRoundR2 v) + = getAngle v v < 0.0001 || isNaN (getAngle v v) + + -- commutative scalarProdProp1 :: Vec -> Vec -> Bool scalarProdProp1 v1 v2 = v1 `scalarProd` v2 == v2 `scalarProd` v1