File: test_rotate_euler.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (13 lines) | stat: -rw-r--r-- 387 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
def test_rotate_euler():
    from math import sqrt
    from ase import Atoms

    d = 1.14
    a = Atoms('CO', [(0, 0, 0), (d, 0, 0)])
    a.euler_rotate(phi=90, theta=45, psi=180)
    for p in a[0].position:
        assert p == 0.0
    assert abs(a[1].position[0]) < 1e-15
    d2 = d / sqrt(2)
    assert abs(a[1].position[1] - d2) < 1e-15
    assert abs(a[1].position[2] - d2) < 1e-15