"""Recalculate the M44 angular-equidistance crossing with Python 3. Inputs and linear J2000 proper-motion convention come from the project's September 28 find_year0.py. This independent check solves the signed equidistance equation by bisection. """ import math # Right ascension and declination in degrees, followed by proper motions # (mu_alpha * cos(delta), mu_delta) in milliarcseconds per Julian year. PROCYON = (114.82550, 5.22499, -714.590, -1036.800) GOMEISA = (111.78780, 8.28941, -50.280, -38.450) M44_CENTRE = (129.8673, 19.7373, -36.0, -12.9) def direction(star, year): ra, dec, mu_ra, mu_dec = star elapsed = year - 2000.0 ra += elapsed * mu_ra / (3_600_000 * math.cos(math.radians(dec))) dec += elapsed * mu_dec / 3_600_000 ra, dec = math.radians(ra), math.radians(dec) return (math.cos(dec) * math.cos(ra), math.cos(dec) * math.sin(ra), math.sin(dec)) def dot(a, b): return math.fsum(x * y for x, y in zip(a, b)) def directions(year): return tuple(direction(star, year) for star in (PROCYON, GOMEISA, M44_CENTRE)) def difference(year): procyon, gomeisa, m44 = directions(year) chord = tuple(g - p for p, g in zip(procyon, gomeisa)) return dot(m44, chord) if __name__ == "__main__": lo, hi = 2900.0, 2930.0 assert difference(lo) * difference(hi) < 0 for _ in range(60): mid = (lo + hi) / 2 if difference(lo) * difference(mid) <= 0: hi = mid else: lo = mid year = (lo + hi) / 2 p, g, m = directions(year) angles = [math.degrees(math.acos(dot(m, star))) for star in (p, g)] normal = (p[1] * g[2] - p[2] * g[1], p[2] * g[0] - p[0] * g[2], p[0] * g[1] - p[1] * g[0]) off_circle = math.degrees(math.asin(abs(dot(m, normal)) / math.sqrt(dot(normal, normal)))) print(f"Model year: {year:.8f} CE") print(f"M44 to Procyon: {angles[0]:.9f} degrees") print(f"M44 to Gomeisa: {angles[1]:.9f} degrees") print(f"Difference: {abs(angles[0] - angles[1]):.3g} degrees") print(f"M44 distance from the stars' great circle: {off_circle:.6f} degrees")