We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d36df79 + 56723ec commit 48d9b20Copy full SHA for 48d9b20
src/math/Vector2.js
@@ -417,12 +417,15 @@ THREE.Vector2.prototype = {
417
418
},
419
420
- rotateAround: function ( center, rotation ) {
+ rotateAround: function ( center, angle ) {
421
422
- var x = this.x - center.x, y = this.y - center.y;
+ var c = Math.cos( angle ), s = Math.sin( angle );
423
424
- this.x = center.x + x * Math.cos(rotation) - y * Math.sin(rotation);
425
- this.y = center.y + y * Math.cos(rotation) + x * Math.sin(rotation);
+ var x = this.x - center.x;
+ var y = this.y - center.y;
426
+
427
+ this.x = x * c - y * s + center.x;
428
+ this.y = x * s + y * c + center.y;
429
430
return this;
431
0 commit comments