@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.
33 lines (32 loc) • 848 B
JavaScript
// @license Copyright © 2021-2023 observerly
const c = (t) => t * Math.PI / 180, r = (t) => t * 180 / Math.PI, h = (t) => {
let o = t % 360;
return o < 0 && (o += 360), Math.abs(o);
}, M = (t) => {
let o = t;
return t > 90 && (o = 180 - t), t < -90 && (o = -180 - t), o;
}, i = (t) => {
const o = Math.floor(Math.abs(t)), n = Math.floor((Math.abs(t) - o) * 60), a = Math.round((Math.abs(t) - o - n / 60) * 3600 * 1e3) / 1e3;
return {
deg: t < 0 ? -o : o,
min: n,
sec: a
};
}, e = (t) => {
t = t % 360, t < 0 && (t += 360);
const o = t / 15, n = Math.floor(o), a = Math.floor((o - n) * 60), s = Math.round((o - n - a / 60) * 3600 * 1e3) / 1e3;
return {
hrs: n,
min: a,
sec: s
};
};
export {
i as a,
e as b,
c,
M as d,
r as e,
h as g
};
//# sourceMappingURL=utilities-BM-rBPno.js.map