From 5a601f39a4832419a62ec7dd5ef884ad6329541e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 14 Jun 2011 12:44:56 +0100 Subject: [PATCH] Fix tests for Point#getDirectedAngle(point). --- test/tests/Point.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/tests/Point.js b/test/tests/Point.js index 57d9ceb1..e021f125 100644 --- a/test/tests/Point.js +++ b/test/tests/Point.js @@ -64,6 +64,15 @@ test('set angle', function() { }); test('getDirectedAngle(point)', function() { - var angle = new Point().getDirectedAngle(new Point(10, 10)); + var angle = new Point(10, 10).getDirectedAngle(new Point(1, 0)); equals(angle, -45); + + var angle = new Point(-10, 10).getDirectedAngle(new Point(1, 0)); + equals(angle, -135); + + var angle = new Point(-10, -10).getDirectedAngle(new Point(1, 0)); + equals(angle, 135); + + var angle = new Point(10, -10).getDirectedAngle(new Point(1, 0)); + equals(angle, 45); }); \ No newline at end of file