计算绕原点旋转某角度后的点的坐标

问题:

A点(x, y)按顺时针旋转 theta 角度后点的坐标为A1点(x1,y1)  ,求x1 y1坐标用(x,y)和 theta 来表示

方法一:

设 OA 向量和x轴的角度为 alpha ,

那么顺时针转过 theta后 ,OA1 向量和x轴的角度为 (alpha - theta) 。

使用圆的参数方程来表示点坐标。A的坐标可以表示为:

\[\left\{ {\begin{array}{*{20}{c}}
  {x = r \cdot \cos \alpha } \\ 
  {y = r \cdot \sin \alpha } 
\end{array}} \right.\]

A1的坐标可以表示为(带入A点坐标进行化简)

\[\left\{ {\begin{array}{*{20}{c}}
  {{x_1} = r \cdot \cos (\alpha  - \theta ) = r \cdot (\cos \alpha \cos \theta  + \sin \alpha \sin \theta ) = x \cdot \cos \theta  + y \cdot \sin \theta } \\ 
  {{y_1} = r \cdot \sin (\alpha  - \theta ) = r \cdot (\sin \alpha \cos \theta  - \cos \alpha \sin \theta ) =  - x \cdot \sin \theta  + y \cdot \cos \theta } 
\end{array}} \right.\]

写成矩阵形式:

\[\left( {\begin{array}{*{20}{c}}
  {\cos \theta }&{\sin \theta } \\ 
  { - \sin \theta }&{\cos \theta } 
\end{array}} \right)\left( {\begin{array}{*{20}{c}}
  x \\ 
  y 
\end{array}} \right) = \left( {\begin{array}{*{20}{c}}
  {{x_1}} \\ 
  {{y_1}} 
\end{array}} \right)\]


方法二:

点顺时针转,相当于 点不变,让坐标轴逆指针转。


坐标为(x,y),可以看成: 

x值是点表示的向量,与x正轴单位向量的点积。

y值是点表示的向量,与y正轴单位向量的点积。

即在x轴和y轴上,带方向的投影长度。


所以问题等价的转化为: 坐标轴逆时针转了theta,求点在新的坐标系下的坐标。


新的坐标系的x正轴单位向量为(用原来的坐标系来表示)

\[(\cos \theta ,\sin \theta )\]

新的坐标系的y正轴单位向量为

\[( - \sin \theta ,\cos \theta )\]


所以

A点新的坐标系下的x值 x1= 点积(A点坐标,新坐标系x正轴单位向量)

A点新的坐标系下的y值 y1= 点积(A点坐标,新坐标系y正轴单位向量)

\[\left\{ {\begin{array}{*{20}{c}}
  {{x_1} = x \cdot \cos \theta  + y \cdot \sin \theta } \\ 
  {{y_1} =  - x \cdot \sin \theta  + y \cdot \cos \theta } 
\end{array}} \right.\]

\[\left( {\begin{array}{*{20}{c}}
  {\cos \theta }&{\sin \theta } \\ 
  { - \sin \theta }&{\cos \theta } 
\end{array}} \right)\left( {\begin{array}{*{20}{c}}
  x \\ 
  y 
\end{array}} \right) = \left( {\begin{array}{*{20}{c}}
  {{x_1}} \\ 
  {{y_1}} 
\end{array}} \right)\]


总结:

顺时针旋转矩阵为:

\[\left( {\begin{array}{*{20}{c}}
  {\cos \theta }&{\sin \theta } \\ 
  { - \sin \theta }&{\cos \theta } 
\end{array}} \right)\]


逆时针旋转矩阵为:(theta 变成 -theta带入即可)

\[\left( {\begin{array}{*{20}{c}}
  {\cos \theta }&{ - \sin \theta } \\ 
  {\sin \theta }&{\cos \theta } 
\end{array}} \right)\]


猜你喜欢

转载自blog.csdn.net/u012138730/article/details/80320162