Use degrees instead of radians for geometry.rotate method (closes #948).

git-svn-id: http://svn.openlayers.org/trunk/openlayers@4127 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-08-30 17:10:26 +00:00
parent b78aec44c9
commit be4180fd75
6 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -159,7 +159,7 @@
// rotate a quarter turn around the origin
var origin = new OpenLayers.Geometry.Point(0, 0);
var angle = Math.PI / 2;
var angle = 90;
ring.rotate(angle, origin);
+4 -4
View File
@@ -92,16 +92,16 @@
// rotate a full revolution
point.bounds = "foo";
point.rotate(2 * Math.PI, origin);
point.rotate(360, origin);
t.ok(((point.x - x) / x) < tolerance,
"rotate by 2 * Math.PI returns to the same y");
"rotate by 360 returns to the same y");
t.ok(((point.y - y) / y) < tolerance,
"rotate by 2 * Math.PI returns to the same y");
"rotate by 360 returns to the same y");
t.ok(point.bounds == null, "bounds is cleared after a rotate()");
// rotate an 1/8 turn
point.rotate(Math.PI / 4, origin);
point.rotate(45, origin);
t.ok(((point.x - 1.4644660940672636) / 1.4644660940672636) < tolerance,
"rotate 1/8 turn correctly");
t.ok(((point.y - 20.606601717798213) / 20.606601717798213) < tolerance,