Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
siuwuncheung committed Nov 19, 2024
1 parent ffd2a8b commit 38a0511
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/PinnedH2O_3DOF/rotation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ def rotation_matrix(axis, angle):

H1_rotated = np.dot(rot_matrix_align_plane, H1)
H2_rotated = np.dot(rot_matrix_align_plane, H2)
bondlength1 = calculate_bondlength(H1_rotated, O1)
bondlength2 = calculate_bondlength(H2_rotated, O1)
bondangle = calculate_bondangle(H1_rotated, O1, H2_rotated, False)
fliped_bond = False
if bondlength1 < bondlength2:
fliped_bond = True
H1_rotated, H2_rotated, bondlength1, bondlength2 = H2_rotated, H1_rotated, bondlength2, bondlength1
H1_rotated, H2_rotated = H2_rotated, H1_rotated
bondlength1 = calculate_bondlength(H1_rotated, O1)
bondlength2 = calculate_bondlength(H2_rotated, O1)
bondangle = calculate_bondangle(H1_rotated, O1, H2_rotated, False)

print('Reference system (z=0 plane about x=0 axis, with longer bondlength in H1)')
print(f'H1 = {H1_rotated}')
Expand Down

0 comments on commit 38a0511

Please sign in to comment.