I wonder why rotation matrices in sympy do not conform right hand rule:
import sympy as sym
print(sym.rot_axis3(sym.Symbol('q')))
produces output:
[[ cos(q), sin(q), 0],
 [-sin(q), cos(q), 0],
 [0,       0,      1]]
Which comparing to right hand rotation:
[[cos(q), -sin(q), 0],
 [sin(q), cos(q), 0],
 [0,      0,      1]]
rotates vector in the opposite direction. This had taken me a few hours of searching for mistakes in my equations before I realized the problem.
Same is true for rot_axis2 and rot_axis1.
In R^3, coordinate system rotations of the x-, y-, and z-axes in a counterclockwise direction when looking towards the origin give the matrices.

(Goldstein 1980, pp. 146-147 and 608; Arfken 1985, pp. 199-200)
Also if you check the 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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With