Example #1
0
def test_some_shit():

    a_milk_rotation = [-0.00014899999999999999, 
                       -0.046429999999999999, 
                       -0.017059000000000001]

    q = ms3d_euler__to__cal3d_quat(*a_milk_rotation)
    print "w,x,y,z",q
    
    q2 = quaternion.fromEuler(*a_milk_rotation)

    print "x,y,z,w", q2.internal

    milk_as_angles = map(quaternion.radians_to_angle, a_milk_rotation)
    
    q3 = ms3d_euler__to__cal3d_quat(*milk_as_angles)
    print "x,y,z,w",q3

    q_forquat = [q[1], q[2], q[3], q[0]]
    q3_forquat = [q3[1], q3[2], q3[3], q3[0]]
    q4 = quaternion.Quaternion(q_forquat)
    q5 = quaternion.Quaternion(q3_forquat)
    print q4.internal

    print "q2", q2.AXYZ()
    print "q4", q4.AXYZ()
    print "q5", q5.AXYZ()
Example #2
0
#!/usr/bin/env python

import quaternion as q

q1 = q.Quaternion((1., 0., 0., 0.))
q2 = q.fromEuler(90., 0., 0.)

print(q1 * q2).getAngleAxis()
Example #3
0
File: yall.py Project: myme/PyCube
#!/usr/bin/env python

import quaternion as q

q1 = q.Quaternion((1.0, 0.0, 0.0, 0.0))
q2 = q.fromEuler(90.0, 0.0, 0.0)

print(q1 * q2).getAngleAxis()