Exemplo n.º 1
0
 def test_rotations_to_static_yz(self, sample_system):
     """ We rotate from z towards y, and compare the results to geometry"""
     r_to_yz = get_rotation_from_z_to_direction(sample_system, [0, 1, 1])
     tan_angle = np.tan(np.deg2rad(r_to_yz[1]))
     tan_lattice = sample_system.lattice.b / sample_system.lattice.c
     assert np.allclose(tan_angle, tan_lattice, atol=1e-5)
Exemplo n.º 2
0
 def test_rotation_to__static_x_axis(self, sample_system):
     r_to_x = get_rotation_from_z_to_direction(sample_system, [1, 0, 0])
     assert np.allclose(r_to_x, (90, 90, -90))
Exemplo n.º 3
0
 def test_rotation_to_static_y_axis(self, sample_system):
     r_to_y = get_rotation_from_z_to_direction(sample_system, [0, 1, 0])
     assert np.allclose(r_to_y, (180, 90, -180))
Exemplo n.º 4
0
def test_zero_rotation_cases(default_structure):
    r_test = get_rotation_from_z_to_direction(default_structure, [0, 0, 2])
    r_test_zero = get_rotation_from_z_to_direction(default_structure,
                                                   [0, 0, 0])
    assert r_test == (0, 0, 0)
    assert r_test_zero == (0, 0, 0)