2017-10-19 77 views
0

我知道对于旋转x = xcos(theta) - ysin(theta)和y = xsin(theta)+ ycos(theta)所以我写了folling代码来做到这一点, (错误的结果),我掏出了为什么。使用缩放器旋转圆形原点

rotate(pScaler) { 
    this.xResult = (this.getX() * Math.cos(this.pScaler)) - (this.getY() * Math.sin(this.pScaler)); 
    this.yResult = (this.getX() * Math.sin(this.pScaler)) + (this.getY() * Math.cos(this.pScaler)); 
    return new Vector(this.xResult, this.yResult, 0); 
} 

回答

0

只是双重检查和放弃我有复制和粘贴正在工作的代码我深情地看着代码操作的错误版本。