@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.
4 lines (3 loc) • 1.09 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./constants.cjs"),u=require("./epoch-BuLOjzKu.cjs");// @license Copyright © 2021-2023 observerly
const f=n=>new Date((n-m.J1970)*864e5),v=(n,e)=>{const{longitude:c}=e;let t=n-c/15;return t<0&&(t+=24),t>24&&(t-=24),t},w=(n,e)=>{e=new Date(e.getTime()+e.getTimezoneOffset()*6e4);const c=u.getJulianDate(new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0))),t=u.getJulianDate(new Date(Date.UTC(e.getFullYear(),1,1,0,0,0,0)))-1,h=c-t,a=(t-2415020)/36525,g=24-(6.6460656+2400.051262*a+2581e-8*a**2)+24*(e.getFullYear()-1900);let o=.0657098*h-g;o<0&&(o+=24),o>24&&(o-=24);let l=n-o;l<0&&(l+=24);const r=.99727*l,i=Math.floor(r),s=Math.floor((r-i)*60),T=Math.floor(((r-i)*60-s)*60),D=Math.floor((((r-i)*60-s)*60-T)*1e3);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),i,s,T,D)};exports.convertGreenwhichSiderealTimeToUniversalTime=w;exports.convertJulianDateToUTC=f;exports.convertLocalSiderealTimeToGreenwhichSiderealTime=v;
//# sourceMappingURL=temporal.cjs.map