?? x , y x,y x,y表示二维坐标系中原坐标点, x ′ , y ′ x',y' x′,y′表示逆时针旋转 β \beta β°之后的坐标点:
x ′ = x cos ? ( β ) ? y sin ? ( β ) y ′ = y cos ? ( β ) + x sin ? ( β ) x' = x \cos(\beta) - y \sin(\beta) \\ y' = y \cos(\beta) + x \sin(\beta) x′=xcos(β)?ysin(β)y′=ycos(β)+xsin(β)
推导如下:
如上图所示,将OA逆时针旋转了beta角度到OB,A的坐标点变为B的坐标点。
??计算OA的距离,如下:
O A = y sin ? ( α ) = x cos ? ( α ) OA = \frac{y}{\sin(\alpha)} = \frac{x}{\cos(\alpha)} OA=sin(α)y?=cos(α)x?
??计算OB的距离,如下:
O B = y ′ sin ? ( α + β ) = x ′ cos ? ( α + β ) OB = \frac{y'}{\sin(\alpha+\beta)} = \frac{x'}{\cos(\alpha+\beta)} OB=sin(α+β)y′?=cos(α+β)x′?
??由于旋转不改变尺度,所有OA=OB=r,由此得:
r = y sin ? ( α ) = x cos ? ( α ) = y ′ sin ? ( α + β ) = x ′ cos ? ( α + β ) r = \frac{y}{\sin(\alpha)} = \frac{x}{\cos(\alpha)}= \frac{y'}{\sin(\alpha+\beta)} = \frac{x'}{\cos(\alpha+\beta)} r