We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6aeebd5 + 0f0e4fe commit 72616d2Copy full SHA for 72616d2
src/biotite/structure/rings.py
@@ -427,7 +427,8 @@ def _minimum_angle(v1, v2):
427
have no 'preferred side'.
428
"""
429
# Do not distinguish between the 'sides' of the rings -> take absolute of cosine
430
- return np.arccos(np.abs(vector_dot(v1, v2)))
+ # Clamp to 1.0, as due to numeric instability values slightly above 1.0 may appear
431
+ return np.arccos(np.minimum(np.abs(vector_dot(v1, v2)), 1.0))
432
433
434
def _is_within_tolerance(angles, expected_angle, tolerance):
0 commit comments