代码片段:rotate:function(theta){varx=this.x;vary=this.y;this.x=Math.cos(theta)*this.x-Math.sin(theta)*this.y;this.y=Math.sin(theta)*this.xMath.cos(theta)*this.y;//this.x=Math.cos(theta)*x-Math.sin(theta)*y;//this.y=Math.sin(theta)*xMath.cos(theta)*y;returnthis;},