@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.
3 lines (2 loc) • 874 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./utilities-HBcnbrPA.cjs"),D=(d,i,g=.42)=>{const{az:h,alt:l}=d,{width:M,height:o}=i,n=g,v=0,e=1,s=Math.cos(a.convertDegreesToRadians(h)-Math.PI),c=Math.sin(a.convertDegreesToRadians(h)-Math.PI),t=Math.sin(a.convertDegreesToRadians(l)),r=Math.cos(a.convertDegreesToRadians(l)),T=2/(1+v*t+e*r*s),z=M/2+n*T*o*r*c,u=o-n*T*o*(e*t-v*r*s);return{x:z,y:u}},R=(d,i,g=.2)=>{const{x:h,y:l}=d,M=0,o=1,n=i.height,v=i.width,e=(h-v/2)/n,s=(n-l)/n,c=Math.sqrt(e**2+s**2),t=2*Math.atan2(c,2*g),r=Math.asin(Math.cos(t)*M+s*Math.sin(t)*o/c),T=Math.PI+Math.atan2(e*Math.sin(t),c*o*Math.cos(t)-s*M*Math.sin(t));return{az:a.convertRadiansToDegrees(T),alt:a.convertRadiansToDegrees(r)}};exports.convertHorizontalToStereo=D;exports.convertStereoToHorizontal=R;
//# sourceMappingURL=projection.cjs.map