@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.
15 lines (14 loc) • 689 B
JavaScript
import { a as n, b as M } from "./utilities-BM-rBPno.js";
// @license Copyright © 2021-2023 observerly
const b = (s) => {
const { deg: a, min: t, sec: e } = n(s), o = a >= 0 ? "+" : "-", r = a > -10 && a < 10 ? "0" : "";
return `${o}${r}${Math.abs(a)}° ${t < 10 ? `0${Math.abs(t)}` : Math.abs(t)}' ${e < 10 ? `0${Math.abs(e)}` : Math.abs(e)}"`;
}, h = (s) => {
const { hrs: a, min: t, sec: e } = M(s);
return `${Math.abs(a) < 10 ? `0${Math.abs(a)}` : a}ʰ ${t < 10 ? `0${Math.abs(t)}` : Math.abs(t)}ᵐ ${e < 10 ? `0${Math.abs(e)}` : Math.abs(e)}ˢ`;
};
export {
b as formatDegreeToDMSHumanized,
h as formatDegreeToHMSHumanized
};
//# sourceMappingURL=humanize.js.map