Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion skyfield/almanac.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ def _transit_ha(latitude, declination, altitude_radians):

def _q(a, b, c, sign):
discriminant = np.maximum(b*b - 4*a*c, 0.0) # avoid tiny negative results
return - 2*c / (b + sign * sqrt(discriminant))
denominator = b + sign * sqrt(discriminant)
q = np.zeros_like(denominator)
return np.divide(-2 * c, denominator, out=q, where=(denominator != 0))

def _intersection(y0, y1, v0, v1):
# Return x at which a curve reaches y=0, given its position and
Expand Down