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