Skip to content

Commit

Permalink
fix: division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
d-led committed Dec 11, 2024
1 parent 7db44ff commit b197199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tbp/monty/frameworks/models/motor_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1251,9 +1251,9 @@ def orienting_angle_from_normal(self, orienting: str) -> float:
x, y, z = rotated_point_normal

if "horizontal" == orienting:
return -np.degrees(np.arctan(x / z))
return -np.sign(x)*90.0 if z == 0 else -np.degrees(np.arctan(x / z))
if "vertical" == orienting:
return -np.degrees(np.arctan(y / z))
return -np.sign(y)*90.0 if z == 0 else -np.degrees(np.arctan(y / z))


###
Expand Down

0 comments on commit b197199

Please sign in to comment.