Exemple #1
0
 def test_q_multiply(self):
     print "\ntest q_multiply"
     q1 = np.array(range(1,5), dtype=float)
     q2 = np.array(range(2,6), dtype=float)
     print q1
     q3 = rotations.q_multiply(q1, q2)
     print repr(q3)
     qtrue = np.array([-36.,   6.,  12.,  12.])
     for v1, v2 in izip(q3, qtrue):
         self.assertAlmostEqual(v1, v2, 4)
Exemple #2
0
def rotate_aa(p1, p2):
    """
    change a given angle axis rotation p1 by the
    rotation p2
    """
    return q2aa(q_multiply( aa2q(p2), aa2q(p1) ))
Exemple #3
0
def rotate_aa(p1, p2):
    """
    change a given angle axis rotation p2 by the
    rotation p1
    """
    return q2aa(q_multiply(aa2q(p2), aa2q(p1)))