UNPKG

atriusmaps-node-sdk

Version:

This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information

2 lines (1 loc) 261 B
const t=t=>t*Math.PI/180;function a(a,h,n,s){const M=t(a),o=t(n),c=t(n-a),i=t(s-h),r=Math.sin(c/2)*Math.sin(c/2)+Math.cos(M)*Math.cos(o)*Math.sin(i/2)*Math.sin(i/2);return 6371e3*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)))}export{a as distance,t as toRadians};