在平面旋转一个点
| | .P | /| | / | | / | | r/ | y | / | | / | |/ @ | ------------------------------------------> |--x----| x = r * cos@; y = r * sin@; p点旋转 Z 角度以后 得到p1(x1,y1)点 x1 = r * cos(@+Z); y1 = r * sin(@+Z); //两角正弦和差公式 //http://zhidao.baidu.com/question/49451901.html //cos(a+b)=cosa*cos(-b)+sina*sin(-b)=cosa*cosb-sina*sinb //sin(a+b)=cos(a-pai/2)cosb-sin(a-pai/2)sinb=sina*cosb+cosa*sinb x1 = r * (cos@*cosZ-sin@*sinZ); = r*cos@*cosZ - r*sin@*sinZ // x = r * cos@; y = r * sin@; = x*cosZ - y*sinZ; y1 = r * (sin@*cosZ+cos@*sinZ); = r*sin@*cosZ + r*cos@*sinZ // x = r * cos@; y = r * sin@; = y*cosZ + x*sinZ p1(x1, y1);
备忘!