@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.
27 lines (26 loc) • 703 B
JavaScript
import { e } from "./utilities-BM-rBPno.js";
function n(r, a) {
if (r < 0)
throw new Error("Invalid focal ratio as aperture is negative");
if (a < 0)
throw new Error("Invalid focal ratio as focal length is negative");
return `f/${a / r}`;
}
function f(r, a, i) {
if (r < 0)
throw new Error("Invalid focal ratio as focal length is negative");
if (a < 0)
throw new Error("Invalid focal ratio as pixel size is negative");
if (i.x < 0 || i.y < 0)
throw new Error("Invalid focal ratio as resolution is negative");
const o = e(a / r);
return {
x: i.x * o,
y: i.y * o
};
}
export {
f as getFieldOfView,
n as getFocalRatio
};
//# sourceMappingURL=optics.js.map