旋转矩阵及左右乘的意义,看这一篇就够了

【自取】最近整理的,有需要可以领取学习:

旋转矩阵及左右乘的意义,别浪费时间了,看这一篇就够了

前言

如今,旋转矩阵的研究被教科书和视频课程搞得很混乱。遗憾的是,没有一篇文章(至少我没有找到它)可以直接解释这样一个简单的概念。一怒之下,我决定自己研究一下。经过不懈的努力,我终于解决了这个可爱又可恨的概念。我也希望看到这篇文章的人能静下心来仔细阅读。这对你一定很有帮助。

[En]

These days, the study of rotation matrix is confused by textbooks and video lessons. Sadly, no article (at least I didn’t find it) can directly explain such a simple concept. In a fit of anger, I decided to study it myself. After unremitting efforts, I finally solved this lovely and hateful concept. I also hope that people who see this article can calm down and read it carefully. It must be helpful for you.

一、什么是旋转矩阵?

首先,我需要花一点时间来谈谈旋转矩阵的含义。你必须知道旋转矩阵有两层含义:坐标变换旋转向量。为了让大家明白,我将举一个最简单的例子。

[En]

First of all, I need to take a moment to talk about the meaning of the rotation matrix. You must know that the rotation matrix has two meanings: * coordinate transformation * and * rotation vector *. In order for you to understand, I will give the simplest example.

1.坐标变换

如图所示,对于点p(或向量),可以用不同的坐标系表示,红色坐标系绕黑色坐标系旋转一个角度:

[En]

As shown in the figure, for point p (or vector), it can be represented in different coordinate systems, and the red coordinate system rotates an angle around the black coordinate system:

旋转矩阵及左右乘的意义,看这一篇就够了

坐标变换关系如下:

[En]

The coordinate transformation relationship is as follows:

旋转矩阵及左右乘的意义,看这一篇就够了

变换关系是由几何关系派生出来的,不管细节如何,我们来看看上面的公式以矩阵形式是什么样子:

[En]

The transformation relation is derived from the geometric relation, regardless of the details, let’s see what the above formula looks like in matrix form:

旋转矩阵及左右乘的意义,看这一篇就够了

中间的2×2矩阵就是我们所说的旋转矩阵。这里特别注意。此矩阵的含义是将旋转的坐标系(红色)中p点的坐标转换为旋转前的坐标系(黑色)。

[En]

The middle 2 × 2 matrix is what we call the rotation matrix. Here * pay special attention to * . The meaning of this matrix is to convert the coordinates of p point in the coordinate system (red) of * rotated * to the coordinate system (black) of * before rotation * .

是什么原因?从代数的角度来看,这是最容易理解的。请不要费心一步一步地跟着我:

[En]

What causes it? It’s easiest to understand from an algebraic point of view. Please don’t bother to follow me step by step:

旋转矩阵的列矢量:

[En]

The column vector of the rotation matrix:

旋转矩阵及左右乘的意义,看这一篇就够了

可以看到,按照几何关系书写的旋转矩阵的列矢量恰好是旋转坐标系(红色)在旋转前的坐标系(黑色)中的坐标轴的坐标,或者方向余弦。

[En]

It can be seen that the column vector of the rotation matrix written according to the geometric relationship happens to be the coordinate of the coordinate axis of the rotating coordinate system (red) in the coordinate system (black) before rotation, or the direction cosine.

也就是说,如果我想写B坐标系相对于A坐标系的旋转矩阵,我只需要把B坐标系相对于AN坐标系的方向余弦写成矩阵的形式,如下图所示:

[En]

In other words, if I want to write the rotation matrix of coordinate system B relative to coordinate system A, I only need to write the directional cosine of coordinate system B relative to coordinate system An in the form of matrix, as shown in the following figure:

旋转矩阵及左右乘的意义,看这一篇就够了
当你看到这个矩阵时,不要混淆,只需看其中一列,它是B坐标系的某一轴在A坐标系的X轴、Y轴和Z轴上的投影,这就是我们所说的方向余弦。我在这里不作太多解释。
[En]

Don’t be confused when you see this matrix, just look at one of the columns, which is the projection of a certain axis of the B coordinate system on the X axis, Y axis and Z axis of the A coordinate system, which is what we call the directional cosine. I don’t explain much here.

然后我们写出这个一般形式的整体情况:

[En]

Then we write out the whole picture of this general form:

旋转矩阵及左右乘的意义,看这一篇就够了
走第一行,实际操作如下:
[En]

Take the first line, and the actual operation is as follows:

旋转矩阵及左右乘的意义,看这一篇就够了

看最左边,它是A坐标系中p点(向量)的x方向坐标,以此类推,旋转矩阵将B坐标系中p点的坐标转换为A坐标系中的坐标。

[En]

Look at the far left, it is the x-direction coordinate of p point (vector) in A coordinate system, and so on, the rotation matrix converts the coordinate of p point in B coordinate system to the coordinate in A coordinate system.

; 2.向量旋转

除了坐标变换的功能外,旋转矩阵的另一个功能是可以旋转向量,这一点我们仍然可以从代数的角度来考虑。

[En]

In addition to the function of coordinate transformation, another function of the rotation matrix is that it can rotate the vector, which we can still consider from an algebraic point of view.

旋转矩阵变换后将向量p转换为配对,如图所示:

[En]

The vector p is transformed into pairing after the rotation matrix transformation, as shown in the figure:

旋转矩阵及左右乘的意义,看这一篇就够了

可以看到,通过将旋转矩阵相乘,将原始向量p变换到新的p‘位置,两者之间的夹角为α,可以非常清楚地告诉大家,此运算的旋转矩阵与上述坐标变换的旋转矩阵相同:

[En]

It can be seen that the original vector p is transformed to the new p ‘position by multiplying the rotation matrix, and the angle between the two is α. I can tell you very clearly that the rotation matrix of this operation is the same as the rotation matrix of the above coordinate transformation:

旋转矩阵及左右乘的意义,看这一篇就够了
此时,您可能会问,为什么同一旋转矩阵有两个函数?
[En]

At this point you may ask, why does the same rotation matrix have two functions?

好,看一下代数,上面的运算可以写成如下:

[En]

OK, look at algebra, the above operation can be written as follows:

旋转矩阵及左右乘的意义,看这一篇就够了
让我们看一下第一行:
[En]

Let’s look at the first line:

旋转矩阵及左右乘的意义,看这一篇就够了

你有没有发现蓝色的方框代表了B坐标系中的一个矢量,但这个矢量的坐标与A*坐标系中的坐标相同。也就是说,旋转矩阵首先对坐标系进行旋转,然后取旋转后坐标系中与原始坐标系相同的向量,再将其投影到原始坐标系上,即可得到旋转后向量的坐标。

[En]

Did you find that the blue box represents a vector in coordinate system B, but the coordinates of this vector are the same as those in coordinate system A * . In other words, the rotation matrix first rotates the coordinate system, and then takes the same vector as the original coordinate system in the rotated coordinate system, and then projects it to the original coordinate system to get the coordinates of the rotated vector.

我想了很多话来描述这个操作,后来发现画的还是比较直观的,请继续往下看:

[En]

I thought a lot of words to describe this operation, and later found that the drawing is still intuitive, please read on:

绘制坐标系A和B,并围绕A旋转坐标系Bα:

[En]

Draw coordinate systems An and B, and rotate coordinate system B α around A:

旋转矩阵及左右乘的意义,看这一篇就够了
在图中添加一个点p,并标记坐标:
[En]

Add a point p to the diagram and mark the coordinates:

旋转矩阵及左右乘的意义,看这一篇就够了
在坐标系B中取与坐标系A相同的坐标,画点,记为p’,注意是相同的坐标

旋转矩阵及左右乘的意义,看这一篇就够了
获取P‘点在A坐标系中的坐标:
[En]

Get the coordinates of the p ‘point in the A coordinate system:

旋转矩阵及左右乘的意义,看这一篇就够了
在脱离B坐标系后,发现矢量p旋转,而坐标系B只是起到中介的作用,这可以理解为矢量p绕坐标系A旋转一定角度。
[En]

After taking off the B coordinate system, it is found that the vector p rotates, and the coordinate system B only acts as an intermediary, which can be understood as that the vector p rotates a certain angle around the coordinate system A.

旋转矩阵及左右乘的意义,看这一篇就够了
到目前为止,我想你已经理解了旋转矩阵的两个功能,一个是坐标变换,一个是向量旋转,同样的旋转矩阵,同样的公式,这取决于你如何解释它,这一点很重要,我们必须弄清楚。
[En]

So far, I think you have understood the two functions of the rotation matrix, one is coordinate transformation, the other is vector rotation, the same rotation matrix, the same formula, it depends on how you explain it, this point is very important, we must be clear.

我知道在座的人肯定不像我这样理解,我会再解释一遍:

[En]

I know there must be people here who don’t understand as well as I do, and I’ll explain it again:

看看这两个公式:

[En]

Look at these two formulas:

旋转矩阵及左右乘的意义,看这一篇就够了
上面是坐标变换,下面是矢量旋转,旋转矩阵必须是相同的,如果我右边蓝色框中的矢量是相同的怎么办?那么左边的价值是一样的吗?那么,左值和右值的物理意义到底是什么呢?这取决于你如何解释它,你是将它解释为向量旋转还是坐标变换。
[En]

The top is the coordinate transformation, the bottom is the vector rotation, the rotation matrix must be the same, what if the vector in the blue box on my right is the same? So is the value on the left the same? So what exactly is the physical meaning of the left and right values? It depends on how you explain it, whether you interpret it as a vector rotation or as a coordinate transformation.

二、矩阵的左右乘

你可能听说过,用左旋转矩阵绕固定坐标系旋转,用右旋转矩阵绕自己的坐标系旋转。简单地记住这句话很容易被误解!首先,这里的左右乘法不是指旋转矩阵的常量左乘或右乘,而是指多个旋转矩阵的组合是左乘还是右乘。其次,这句话还省略了一个很重要的信息,围绕固定坐标系旋转讨论了矢量的旋转,讨论了围绕自己坐标系旋转的坐标变换!这是两种完全不同的功能。例如,我想研究一个向量的旋转。我可以或者只能把它想象成一个绕固定坐标系旋转的矢量。往下看。

[En]

As you may have heard, * rotate around the fixed coordinate system by the left rotation matrix and rotate around the own coordinate system by the right rotation matrix. Simply remembering this sentence is easy to be misunderstood! First of all, the left and right multiplication here does not refer to a constant left or right multiplication of the rotation matrix, but whether the combination of multiple rotation matrices is left or right multiplication. Secondly, this sentence also omitted a very important information, * rotation around a fixed coordinate system discusses the rotation of vectors, rotation around its own coordinate system discusses coordinate transformation! These are two completely different functions. For example, I want to study the rotation of a vector. I can or can only think of it as a vector rotating around a fixed coordinate system. Look down.

1.旋转矩阵左乘

我想要一个矢量P0绕x轴旋转α度,然后绕y轴旋转β度,最后绕z轴旋转Gamma度,以找到旋转后向量的位置。

[En]

I want a vector p0 to rotate alpha degrees around the x axis, then beta degrees around the y axis, and finally gamma degrees around the z axis to find the position of the rotation rear vector.

由此可见,这是一个旋转矩阵组合的问题。如前所述,向量绕特定轴的旋转在数学上表示为向量左乘旋转矩阵。当然,根据主题的意思,先让它绕x轴旋转:

[En]

It can be seen that this is a problem of rotation matrix combination. As discussed before, vector rotation around a certain axis is mathematically expressed as a vector left multiplying the rotation matrix. According to the meaning of the topic, of course, let it rotate around the x axis first:

旋转矩阵及左右乘的意义,看这一篇就够了

然后绕y轴旋转:

[En]

Then rotate around the y-axis:

旋转矩阵及左右乘的意义,看这一篇就够了

然后绕z轴旋转,则p3为向量:

[En]

Then rotate around the z axis, then p3 is the vector:

旋转矩阵及左右乘的意义,看这一篇就够了

总而言之,它是:

[En]

Together, it is:

旋转矩阵及左右乘的意义,看这一篇就够了

总旋转矩阵R:

[En]

Total rotation matrix R:

旋转矩阵及左右乘的意义,看这一篇就够了
重点是设向量P0依次绕x、y、z轴旋转,向量P0的总旋转力矩R就是矩阵绕x轴旋转,矩阵绕y
轴旋转,再绕z轴旋转。
[En]

The point is that let the vector p0 rotate around the x, y and z axes successively, and the total rotation torque R of the vector p0 is the matrix rotated around the x axis by the matrix rotated around the y < br > axis and then the matrix rotated around the z axis.

从这里引入的一句话是,左边的乘法绕着固定的坐标系旋转,现在让我们改变它。我们应该这样说:当我们讨论向量旋转问题时,我们认为向量绕固定的轴旋转,旋转矩阵按旋转顺序乘以左。

[En]

The sentence introduced from this is that the left multiplication rotates around the fixed coordinate system, and now let’s change it. We should say this: when we discuss the problem of vector rotation, we think that the vector rotates around the fixed axis, and the rotation matrix is multiplied by the left in the order of rotation.

; 2.旋转矩阵右乘

右乘讨论的是坐标变换。让我们来看看这个问题:给定在C坐标系中表示的向量PC,我想要找到PC在原始坐标系0中的表示P0。已知的C坐标系从原来的坐标系0绕X0轴旋转1度到A坐标系,然后绕YA轴旋转到B坐标系,然后绕ZB轴旋转到C坐标系。

[En]

The right multiplication discusses the coordinate transformation. Let’s look at the problem: given the vector pC expressed in the C coordinate system, I want to find the representation p0 of pC in the original coordinate system 0. The known C coordinate system rotates a degree from the original coordinate system 0 around the axis X0 to the coordinate system A, then rotates around the axis YA to the coordinate system B, and then rotates around the axis ZB to the coordinate system C.

如果这里的逻辑不合理,只需考虑一段时间(大脑修复如何旋转,这一次是围绕自己的坐标系)。

[En]

If the logic doesn’t make sense here, just think about it for a while, (brain repair how to rotate, this time around its own coordinate system).

还记得之前的那张照片吗?我把它拿到这里,让你再看一眼:

[En]

Remember that picture before? I’ll bring it here for you to take another look:

旋转矩阵及左右乘的意义,看这一篇就够了
同样,B坐标系中p点的坐标乘以旋转矩阵,得到A坐标系中的坐标,而B坐标系从A坐标系旋转到α角。可以发现,这是一种“退却”效应,即旋转后坐标系中的p点左乘旋转矩阵后,就变成了旋转前坐标系中的坐标。该效果表明,旋转后的坐标系必须绕旋转前坐标系的一条轴旋转。对于预转坐标系,可以理解为它绕自己坐标系的轴旋转。换句话说,因为你回去得到前坐标系中的坐标,你必须绕着前坐标系中的轴转,所以我们称之为绕着你自己的坐标系旋转*(如果你喜欢的话,读两遍)你必须在这里理解它。
[En]

Once again, the coordinates of the p point in the B coordinate system, multiplied by the rotation matrix, get the coordinates in the A coordinate system, while the B coordinate system is turned from the A coordinate system to the α angle. It can be found that this is a “retreat” effect, that is, after the p point in the rotated coordinate system left multiplies the rotation matrix, it will become the coordinate in the pre-rotation coordinate system. This effect shows that the rotated coordinate system must revolve around one of the axes of the pre-rotational coordinate system. For the pre-rotational coordinate system, it can be understood that it rotates around the axis of its own coordinate system. In other words, because you go back and get the coordinates in the front coordinate system, you have to turn around the axis in the front coordinate system, so we call it rotating around your own coordinate system *

(read it twice if you feel like it) you must understand it here.

回过头来看,我们知道PC要求P0,那么让我们一步一步回到坐标系0:

[En]

Looking back, we know that pC asks for p0, so let’s go back step by step to coordinate system 0:

首先,将坐标系C返回到B坐标系(应该说,将C系中的p向量的表示转换为B系中的表示):

[En]

First of all, the coordinate system C is returned to the coordinate system B, (it should be said that the representation of the p vector in the C system is transformed into the representation in the B system):

旋转矩阵及左右乘的意义,看这一篇就够了
然后从坐标系B返回到坐标系A:
[En]

Then return from coordinate system B to coordinate system A:

旋转矩阵及左右乘的意义,看这一篇就够了
然后从坐标系A返回到坐标系0:
[En]

Then return from coordinate system A to coordinate system 0:

旋转矩阵及左右乘的意义,看这一篇就够了
它的连接方式如下:
[En]

It is connected as follows:

旋转矩阵及左右乘的意义,看这一篇就够了
总旋转矩阵R为:
[En]

The total rotation matrix R is:

旋转矩阵及左右乘的意义,看这一篇就够了
如前所述,坐标系C是通过将坐标系0从坐标系0改变为绕X0轴的坐标系A,然后改变为绕轴YA的坐标系B,然后绕轴ZB旋转来获得的。为了让它往回走,我们来看看旋转矩阵R的书写,是关于x轴旋转矩阵右乘y轴右旋转乘以z轴旋转矩阵吗?这就是我们所说的旋转矩阵绕其自身轴旋转的右乘。
[En]

As mentioned before, coordinate system C is obtained by changing coordinate system 0 from coordinate system 0 to coordinate system An around axis X0, then to coordinate system B around axis YA, and then rotating around axis ZB. In order to make it go back, let’s take a look at the writing of rotation matrix R, is it about x axis rotation matrix right times y axis rotation right times z axis rotation matrix? * this is what we call the right multiplication of the rotation matrix by rotating around its own axis. *

总结

根据大数定律和正态分布,我们大多数人的智商处于人类的平均水平,但精英教育不允许这样基本和冗长的解释方式。晦涩难懂的课本、千篇一律的ppt和随意的讲解是我们普通学生获取知识的最大障碍,这导致了大量不懂课本、跟不上课程的人。CSDN的出现或许能够为普通学生的学习搭建一条快速通道。希望大家能够一起以通俗易懂的视角来解释问题,共同创造一个良好的知识环境。

[En]

According to the law of large numbers and normal distribution, the IQ of most of us is at the average level of human beings, but elite education does not allow such a basic and lengthy way of explanation. Obscure textbooks, stereotyped ppt and casual explanation are the biggest obstacles for us ordinary students to acquire knowledge, which leads to a large number of people who do not understand textbooks and cannot keep up with the curriculum. The emergence of csdn may be able to build a fast channel for ordinary students’ learning. I hope you can work together to explain the problem in an easy-to-understand perspective and create a good knowledge environment together.

如果有任何错误,请改正。如果你有什么好的概念,请把它们加进来。

[En]

If there are any mistakes, please correct them. If you have any good concepts, please add them.

Original: https://blog.csdn.net/weixin_45632220/article/details/117735223
Author: 默以成之
Title: 旋转矩阵及左右乘的意义,看这一篇就够了

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/6283/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

发表回复

登录后才能评论
免费咨询
免费咨询
扫码关注
扫码关注
联系站长

站长Johngo!

大数据和算法重度研究者!

持续产出大数据、算法、LeetCode干货,以及业界好资源!

2022012703491714

微信来撩,免费咨询:xiaozhu_tec

分享本页
返回顶部