2017-04-15 6 views
0

sympyでの回転行列は、右手の法則に準拠していない理由を私は疑問に思う: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_axis2およびrot_axis1についても同様です。

+1

チェックこの:http://mathworld.wolfram.com/RotationMatrix.html、R_z = rot_axis3、http://docs.sympy.org/dev/_modules/sympy/matrices/dense.html – eyllanesc

+0

@eyllanescありがとう!そのような大会については知らなかった。あなたが答えを書くなら私はそれを適用します。 –

+0

私はすでに私の答えを書いています。 – eyllanesc

答えて

1

R^3では、原点に向かって見て反時計回りのx軸、y軸、z軸の座標系の回転が行列になります。

enter image description here

(ゴールドスタイン1980年、頁146から147及び608; Arfken 1985、頁199-200。)

また、あなたがsympy documentationをチェックした場合:

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)