如何找到两个坐标系之间的旋转矩阵? [英] How to find the rotation matrix between two coordinate systems?
问题描述
有两个坐标系。我们知道相对于第一坐标系的第二坐标系的原点的3D坐标和轴的3D矢量。那么我们如何找到将第一坐标系转换为第二坐标系的旋转矩阵?
There are two coordinate systems. We know the 3D coordinates of the origin and the 3D vectors of the axes of the second coordinate system with respect to the first coordinates system. Then how can we find the rotation matrix that transforms the first coordinate system into the second coordinate system?
推荐答案
所描述的问题可以通过以下方法解决。
The problem described can be solved as follows. Let
M = m_11 m_12 m_13
m_21 m_22 m_23
m_31 m_32 m_33
表示所需的旋转矩阵。我们要求
denote the desired rotation matrix. We require
1 0 0 * M + t = x_x x_y x_z
0 1 0 y_x y_y y_z
0 0 1 z_x z_y z_y
其中 t
表示翻译;我们看到,可以通过从左边乘以恒等式(即恒等式)来解决这个矩阵相等性。因此我们得到以下等式。
where t
denotes the translation; we see that this matrix equality can be solved by multiplying from the left with the identity matrix, which is the inverse of itself; hence we obtain the following equality.
M + t = x_x x_y x_z
y_x y_y y_z
z_x z_y z_y
可以通过减去 t
从双方获得所需的矩阵 M
,如下所示。
This can be rearranged by subtracting t
from both sides to obtain the desired matrix M
as follows.
M = x_x x_y x_z - t = x_x-t_x x_y-t_y x_z-t_z
y_x y_y y_z y_x-t_x y_y-t_y y_z-t_z
z_x z_y z_y z_x-t_x z_y-t_y z_z-t_z
请注意,这是相对容易的,因为初始矩阵由标准基数的基本向量组成。通常,这比较困难,并且涉及基础转换,该转换基本上可以通过高斯消除,但是在数字上可能很困难。
Note that this was relatively easy as the initial matrix consists out of the basic vectors of the standard base. In general it is more difficult and involves a basis transformation, which basically can be done by Gaussian elimination, but can be numerically difficult.
这篇关于如何找到两个坐标系之间的旋转矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!