Skip to content

Commit

Permalink
Test Frame3d a bit more precisely
Browse files Browse the repository at this point in the history
Check sign of triple product as well as magnitude
  • Loading branch information
ianmackenzie committed Mar 3, 2017
1 parent 8aa69ce commit bcf22c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/Frame3d.elm
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ frameDirectionsAreOrthonormal =
tripleProduct =
Vector3d.crossProduct xDirectionVector yDirectionVector
|> Vector3d.dotProduct zDirectionVector

expectedTripleProduct =
if Frame3d.isRightHanded frame then
1
else
-1
in
Expect.approximately 1 (abs tripleProduct)
Expect.approximately expectedTripleProduct tripleProduct
)


Expand Down

0 comments on commit bcf22c0

Please sign in to comment.