Fix tests for Point#getDirectedAngle(point).

This commit is contained in:
Jürg Lehni 2011-06-14 12:44:56 +01:00
parent c85ddf2abe
commit 5a601f39a4

View file

@ -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);
});