UNPKG

@observerly/astrometry

Version:

observerly's lightweight, zero-dependency, type safe astrometry library written in Typescript for calculating the position of celestial objects in the sky.

34 lines (33 loc) 2.07 kB
import { getObliquityOfTheEcliptic as D, getHourAngle as E } from "./astrometry.js"; import { c as m, EARTH_RADIUS as L } from "./constants.js"; import { getEccentricityOfOrbit as O } from "./earth.js"; import { g as b } from "./epoch-nmyjNjKp.js"; import { getLunarMeanEclipticLongitudeOfTheAscendingNode as q, getLunarMeanGeometricLongitude as R } from "./moon.js"; import { getSolarMeanGeometricLongitude as S, getSolarTrueGeometricLongitude as C } from "./sun.js"; import { c as n, e as g } from "./utilities-BM-rBPno.js"; // @license Copyright © 2021-2025 observerly const F = (c, s) => { const o = n(s.ra), t = n(s.dec), i = (b(c) - 2451545) / 36525, l = q(c), e = S(c), d = R(c), p = 9.2 * Math.cos(n(l)) + 0.57 * Math.cos(n(2 * e)) + 0.1 * Math.cos(n(2 * d)) - 0.09 * Math.cos(n(2 * l)), r = n(D(c) + p / 3600), h = n(20.49552 / 3600), f = O(c), M = n(102.93735 + 1.71953 * i + 46e-5 * i ** 2), u = n(C(c)), T = -h * (Math.cos(o) * Math.cos(u) * Math.cos(r) + Math.sin(o) * Math.sin(u) / Math.cos(t)) + f * h * (Math.cos(o) * Math.cos(M) * Math.cos(r) + Math.sin(o) * Math.sin(M) / Math.cos(t)), A = -h * (Math.cos(u) * Math.cos(r) * (Math.tan(r) * Math.cos(t) - Math.sin(o) * Math.sin(t)) + Math.cos(o) * Math.sin(t) * Math.sin(u)) + f * h * (Math.cos(M) * Math.cos(r) * (Math.tan(r) * Math.cos(t) - Math.sin(o) * Math.sin(t)) + Math.cos(o) * Math.sin(t) * Math.sin(M)); return { ra: g(T), dec: g(A) }; }, G = (c, s, o) => { const t = n(o.dec), a = n(s.latitude), i = E(c, s.longitude, o.ra), e = 7292115e-11 * L * Math.cos(a), d = e / m * (Math.cos(a) * Math.sin(i)) / Math.cos(t), p = e / m * (Math.sin(a) * Math.cos(t) - Math.cos(a) * Math.sin(t) * Math.cos(i)); return { ra: g(d), dec: g(p) }; }, U = (c, s, o) => { const t = F(c, o), a = G(c, s, o); return { ra: t.ra + a.ra, dec: t.dec + a.dec }; }; export { U as getCorrectionToEquatorialForAberration, F as getCorrectionToEquatorialForAnnualAberration, G as getCorrectionToEquatorialForDiurnalAberration }; //# sourceMappingURL=aberration.js.map