Skip to content

Commit

Permalink
Some versions of Python do not allow hypot to have more than 2 argume…
Browse files Browse the repository at this point in the history
…nts.
  • Loading branch information
cosinekitty committed May 27, 2024
1 parent 7c475fc commit 9c5f989
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demo/python/astronomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ def _inverse_terra(ovec: List[float], st: float) -> Observer:
# Start with initial latitude estimate, based on a spherical Earth.
lat = math.atan2(z, p)
count = 0
distanceAu = max(1.0, math.hypot(ovec[0], ovec[1], ovec[2]))
distanceAu = max(1.0, math.sqrt(ovec[0]**2 + ovec[1]**2 + ovec[2]**2))
while True:
count += 1
if count > 10:
Expand Down
2 changes: 1 addition & 1 deletion generate/template/astronomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ def _inverse_terra(ovec: List[float], st: float) -> Observer:
# Start with initial latitude estimate, based on a spherical Earth.
lat = math.atan2(z, p)
count = 0
distanceAu = max(1.0, math.hypot(ovec[0], ovec[1], ovec[2]))
distanceAu = max(1.0, math.sqrt(ovec[0]**2 + ovec[1]**2 + ovec[2]**2))
while True:
count += 1
if count > 10:
Expand Down
2 changes: 1 addition & 1 deletion source/python/astronomy/astronomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ def _inverse_terra(ovec: List[float], st: float) -> Observer:
# Start with initial latitude estimate, based on a spherical Earth.
lat = math.atan2(z, p)
count = 0
distanceAu = max(1.0, math.hypot(ovec[0], ovec[1], ovec[2]))
distanceAu = max(1.0, math.sqrt(ovec[0]**2 + ovec[1]**2 + ovec[2]**2))
while True:
count += 1
if count > 10:
Expand Down

0 comments on commit 9c5f989

Please sign in to comment.