Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix: domain error at acos [1,-1]
Browse files Browse the repository at this point in the history
  • Loading branch information
uysalibov committed Mar 14, 2024
1 parent 7a5f895 commit 04a1b62
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion marble-sculp/disc.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ def baecher(
-math.sin(echis),
]
fisher_dip_dev_angle = math.acos(
(fisher_constant + math.log(1 - np.random.uniform())) / fisher_constant
max(
min(
(fisher_constant + math.log(1 - np.random.uniform()))
/ fisher_constant,
1,
),
-1,
)
)
echis = (math.pi / 2) - (dip - fisher_dip_dev_angle)
pole_dip_rotated = [
Expand Down

0 comments on commit 04a1b62

Please sign in to comment.