SymPy旋转矩阵的方向

4
我想知道为什么sympy中的旋转矩阵不符合右手定则:
import sympy as sym
print(sym.rot_axis3(sym.Symbol('q')))

生成输出:

[[ cos(q), sin(q), 0],
 [-sin(q), cos(q), 0],
 [0,       0,      1]]

与右手旋转相比:

[[cos(q), -sin(q), 0],
 [sin(q), cos(q), 0],
 [0,      0,      1]]

将向量逆时针旋转。在我发现问题之前,我花费了几个小时搜索方程式中的错误。

rot_axis2rot_axis1 同样如此。


1
请查看以下内容:http://mathworld.wolfram.com/RotationMatrix.html,其中 R_z = rot_axis3,并访问http://docs.sympy.org/dev/_modules/sympy/matrices/dense.html。 - eyllanesc
@eyllanesc 非常感谢!我甚至不知道有这样的惯例。如果您写一个答案,我会应用它的。 - Long Smith
我已经写好了我的答案。 - eyllanesc
1个回答

4
在三维空间中,当从原点朝向观察时,绕x轴、y轴和z轴逆时针旋转的坐标系变换可以表示为矩阵形式。

enter image description here

(Goldstein 1980,第146-147页和608页; Arfken 1985,第199-200页)

另外,如果您查看sympy 文档

def rot_axis3(theta):
    """Returns a rotation matrix for a rotation of theta (in radians) about
    the 3-axis.
    [...]
    """
    ct = cos(theta)
    st = sin(theta)
    lil = ((ct, st, 0),
           (-st, ct, 0),
           (0, 0, 1))
    return Matrix(lil)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接