问小白 wenxiaobai
资讯
历史
科技
环境与自然
成长
游戏
财经
文学与艺术
美食
健康
家居
文化
情感
汽车
三农
军事
旅行
运动
教育
生活
星座命理

旋转矩阵:点旋转和坐标系旋转

创作时间:
作者:
@小白创作中心

旋转矩阵:点旋转和坐标系旋转

引用
CSDN
1.
https://blog.csdn.net/Lee_Mon_Tree/article/details/136880423

点旋转


点P在直角坐标系下的坐标为(x,y),表示成极坐标(r,α),则有关系式:
{ x = r ⋅ cos ⁡ α y = r ⋅ sin ⁡ α \left{\begin{array}{l} x=r \cdot \cos \alpha \ y=r \cdot \sin \alpha \end{array}\right.{x=r⋅cosαy=r⋅sinα
点P绕坐标系原点逆时针旋转θ角度,得点P’的坐标为(x’,y’),极坐标表示为(r,α+θ),则有关系式:
{ x ′ = r ⋅ cos ⁡ ( α + θ ) = r ⋅ cos ⁡ α ⋅ cos ⁡ θ − r ⋅ sin ⁡ α ⋅ sin ⁡ θ y ′ = r ⋅ sin ⁡ ( α + θ ) = r ⋅ sin ⁡ α ⋅ cos ⁡ θ + r ⋅ cos ⁡ α ⋅ sin ⁡ θ \left{\begin{array}{l} x^{\prime}=r \cdot \cos (\alpha+\theta)=r \cdot \cos \alpha \cdot \cos \theta-r \cdot \sin \alpha \cdot \sin \theta \ y^{\prime}=r \cdot \sin (\alpha+\theta)=r \cdot \sin \alpha \cdot \cos \theta+r \cdot \cos \alpha \cdot \sin \theta \end{array}\right.{x′=r⋅cos(α+θ)=r⋅cosα⋅cosθ−r⋅sinα⋅sinθy′=r⋅sin(α+θ)=r⋅sinα⋅cosθ+r⋅cosα⋅sinθ
化简可得:
{ x ′ = x ⋅ cos ⁡ θ − y ⋅ sin ⁡ θ y ′ = y ⋅ cos ⁡ θ + x ⋅ sin ⁡ θ \left{\begin{array}{l} x^{\prime}=x \cdot \cos \theta-y \cdot \sin \theta \ y^{\prime}=y \cdot \cos \theta+x \cdot \sin \theta \end{array}\right.{x′=x⋅cosθ−y⋅sinθy′=y⋅cosθ+x⋅sinθ
写成矩阵的形式为:
[ x ′ y ′ ] = [ cos ⁡ θ − sin ⁡ θ sin ⁡ θ cos ⁡ θ ] [ x y ] \left[\begin{array}{l} x^{\prime} \ y^{\prime} \end{array}\right]=\left[\begin{array}{cc} \cos \theta & -\sin \theta \ \sin \theta & \cos \theta \end{array}\right]\left[\begin{array}{l} x \ y \end{array}\right][x′y′ ]=[cosθsinθ −sinθcosθ ][xy ]
则点P到点P’的旋转矩阵可表示为:
R p o i n t = [ cos ⁡ θ − sin ⁡ θ sin ⁡ θ cos ⁡ θ ] R_{point} =\left[\begin{array}{cc} \cos \theta & -\sin \theta \ \sin \theta & \cos \theta \end{array}\right]Rpoint =[cosθsinθ −sinθcosθ ]

坐标系旋转


点P在直角坐标系下的坐标为(x,y),表示成极坐标(r,α),则有关系式:
{ x = r ⋅ cos ⁡ α y = r ⋅ sin ⁡ α \left{\begin{array}{l} x=r \cdot \cos \alpha \ y=r \cdot \sin \alpha \end{array}\right.{x=r⋅cosαy=r⋅sinα
点P不动,坐标系绕原点逆时针旋转θ角度,坐标变为(x’,y’),极坐标为(r,α-θ),则有关系式:
{ x ′ = r ⋅ cos ⁡ ( α − θ ) = r ⋅ cos ⁡ α ⋅ cos ⁡ θ + r ⋅ sin ⁡ α ⋅ sin ⁡ θ y ′ = r ⋅ sin ⁡ ( α − θ ) = r ⋅ sin ⁡ α ⋅ cos ⁡ θ − r ⋅ cos ⁡ α ⋅ sin ⁡ θ \left{\begin{array}{l} x^{\prime}=r \cdot \cos (\alpha-\theta)=r \cdot \cos \alpha \cdot \cos \theta+r \cdot \sin \alpha \cdot \sin \theta \ y^{\prime}=r \cdot \sin (\alpha-\theta)=r \cdot \sin \alpha \cdot \cos \theta-r \cdot \cos \alpha \cdot \sin \theta \end{array}\right.{x′=r⋅cos(α−θ)=r⋅cosα⋅cosθ+r⋅sinα⋅sinθy′=r⋅sin(α−θ)=r⋅sinα⋅cosθ−r⋅cosα⋅sinθ
化简可得:
{ x ′ = x ⋅ cos ⁡ θ + y ⋅ sin ⁡ θ y ′ = y ⋅ cos ⁡ θ − x ⋅ sin ⁡ θ \left{\begin{array}{l} x^{\prime}=x \cdot \cos \theta+y \cdot \sin \theta \ y^{\prime}=y \cdot \cos \theta-x \cdot \sin \theta \end{array}\right.{x′=x⋅cosθ+y⋅sinθy′=y⋅cosθ−x⋅sinθ
写成矩阵的形式为:
[ x ′ y ′ ] = [ cos ⁡ θ sin ⁡ θ − sin ⁡ θ cos ⁡ θ ] [ x y ] \left[\begin{array}{l} x^{\prime} \ y^{\prime} \end{array}\right]=\left[\begin{array}{cc} \cos \theta & \sin \theta \ -\sin \theta & \cos \theta \end{array}\right]\left[\begin{array}{l} x \ y \end{array}\right][x′y′ ]=[cosθ−sinθ sinθcosθ ][xy ]
则坐标系OXY旋转到坐标系O’X’Y’的旋转矩阵可表示为:
R c o o r d i n a t e = [ cos ⁡ θ sin ⁡ θ − sin ⁡ θ cos ⁡ θ ] R_{coordinate} =\left[\begin{array}{cc} \cos \theta & \sin \theta \ -\sin \theta & \cos \theta \end{array}\right]Rcoordinate =[cosθ−sinθ sinθcosθ ]

总结

  1. 点旋转:在坐标系OXY中,存在点P,点P经过旋转到点P’,旋转矩阵为R p o i n t R_{point}Rpoint ,则P ’ = R p o i n t ∗ P P’=R_{point}*{P}P’=Rpoint ∗P;
  2. 坐标系旋转:在坐标系OXY中,存在点P,坐标系OXY经过旋转变为坐标系O’X’Y’,则点P的坐标改变为P’,旋转矩阵为R c o o r d i n a t e R_{coordinate}Rcoordinate ,则P ’ = R c o o r d i n a t e ∗ P P’=R_{coordinate}*{P}P’=Rcoordinate ∗P;
    当点旋转和坐标系旋转的旋转角度和旋转方向一样时,可以发现R p o i n t R_{point}Rpoint 与R c o o r d i n a t e R_{coordinate}Rcoordinate 是互逆关系,即R p o i n t = R c o o r d i n a t e t R_{point}=R^{t}_{coordinate}Rpoint =Rcoordinatet 。
© 2023 北京元石科技有限公司 ◎ 京公网安备 11010802042949号