Пример #1
0
 def test_find_rotor_aligning_vectors(self):
     """
     Currently fails, needs to be dug into
     """
     from clifford.g3c import layout
     e1 = layout.blades['e1']
     e2 = layout.blades['e2']
     from clifford.tools.g3 import random_euc_mv, random_rotation_rotor, rotor_align_vecs
     u_list = [random_euc_mv() for i in range(50)]
     for i in range(100):
         r = random_rotation_rotor()
         v_list = [r * u * ~r for u in u_list]
         r_2 = rotor_align_vecs(u_list, v_list)
         print(r_2)
         print(r)
         testing.assert_almost_equal(r.value, r_2.value)
Пример #2
0
def random_rotation_translation_rotor(maximum_translation=10.0,
                                      maximum_angle=np.pi):
    """ generate a random combined rotation and translation rotor """
    return (random_translation_rotor(maximum_translation) *
            random_rotation_rotor(maximum_angle)).normal()
Пример #3
0
def random_rotation_translation_rotor(maximum_translation=10.0, maximum_angle=np.pi):
    """ generate a random combined rotation and translation rotor """
    return (random_translation_rotor(maximum_translation)*random_rotation_rotor(maximum_angle)).normal()