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.

4 lines (3 loc) 773 B
"use strict";// @license Copyright © 2021-2023 observerly const a=t=>t*Math.PI/180,c=t=>t*180/Math.PI,s=t=>{let o=t%360;return o<0&&(o+=360),Math.abs(o)},i=t=>{let o=t;return t>90&&(o=180-t),t<-90&&(o=-180-t),o},M=t=>{const o=Math.floor(Math.abs(t)),n=Math.floor((Math.abs(t)-o)*60),e=Math.round((Math.abs(t)-o-n/60)*3600*1e3)/1e3;return{deg:t<0?-o:o,min:n,sec:e}},h=t=>{t=t%360,t<0&&(t+=360);const o=t/15,n=Math.floor(o),e=Math.floor((o-n)*60),r=Math.round((o-n-e/60)*3600*1e3)/1e3;return{hrs:n,min:e,sec:r}};exports.convertDegreeToDMS=M;exports.convertDegreeToHMS=h;exports.convertDegreesToRadians=a;exports.convertRadiansToDegrees=c;exports.getNormalizedAzimuthalDegree=s;exports.getNormalizedInclinationDegree=i; //# sourceMappingURL=utilities-HBcnbrPA.cjs.map