@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.
3 lines (2 loc) • 1.78 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./epoch-BuLOjzKu.cjs"),o=require("./utilities-HBcnbrPA.cjs"),S=(e,n)=>{let t=o.convertRadiansToDegrees(Math.acos(Math.sin(o.convertDegreesToRadians(e.θ))*Math.sin(o.convertDegreesToRadians(n.θ))+Math.cos(o.convertDegreesToRadians(e.θ))*Math.cos(o.convertDegreesToRadians(n.θ))*Math.cos(o.convertDegreesToRadians(e.φ-n.φ))))%360;return t<0&&(t+=360),t},D=e=>({θ:(e.θ+180)%360,φ:-e.φ}),M=e=>{const{θ:n,φ:t}=e;return{θ:o.getNormalizedAzimuthalDegree(n),φ:o.getNormalizedInclinationDegree(t)}},d=e=>{const n=T.getJulianDate(e),r=(Math.floor(n-.5)+.5-2451545)/36525;let s=(6.697374558+2400.051336*r+25862e-9*r**2)%24;s<0&&(s+=24);const i=T.utc(e),c=(i.getUTCHours()+i.getUTCMinutes()/60+i.getUTCSeconds()/3600+i.getUTCMilliseconds()/36e5)*1.002737909;s+=c;const l=s%24;return l<0?l+24:l},v=d,u=(e,n)=>{let a=(d(e)+n/15)/24;return a=a-Math.floor(a),a<0&&(a+=1),24*a},R=u,h=(e,n,t)=>{let r=u(e,n)*15-t;return r<0&&(r+=360),r},f=e=>{const t=(T.getJulianDate(e)-2451545)/36525;return 23.439292-(46.845*t+59e-5*t**2+.001813*t**3)/3600},p=(e,n,t)=>{const{latitude:a,longitude:r}=n,{ra:s,dec:i}=t,g=o.convertDegreesToRadians(h(e,r,s));let c=o.convertRadiansToDegrees(Math.atan2(Math.sin(g),Math.tan(o.convertDegreesToRadians(a))*Math.cos(o.convertDegreesToRadians(i))-Math.sin(o.convertDegreesToRadians(i))*Math.cos(g)));return c<0&&(c+=360),c%360};exports.GST=v;exports.LST=R;exports.getAngularSeparation=S;exports.getAntipodeCoordinate=D;exports.getGreenwhichSiderealTime=d;exports.getHourAngle=h;exports.getLocalSiderealTime=u;exports.getNormalisedSphericalCoordinate=M;exports.getObliquityOfTheEcliptic=f;exports.getParallacticAngle=p;
//# sourceMappingURL=astrometry.cjs.map