"use strict";exports.CalculateDistance=function(t,a){if(!t||!a)return console.error("坐标点不能为空"),0;console.log("point1",t),console.log("point2",a);const n=Number(t.latitude),o=Number(t.longitude),e=Number(a.latitude),r=Number(a.longitude);if(isNaN(n)||isNaN(o)||isNaN(e)||isNaN(r)||n<-90||n>90||e<-90||e>90||o<-180||o>180||r<-180||r>180)return console.error("无效的坐标值",{lat1:n,lng1:o,lat2:e,lng2:r}),0;if(n===e&&o===r)return 0;const s=t=>t*(Math.PI/180),i=s(n),l=s(e),u=s(e-n),c=s(r-o),N=Math.sin(u/2),h=Math.sin(c/2),M=N*N+Math.cos(i)*Math.cos(l)*h*h,g=Math.min(Math.max(M,0),1),d=6371008.7714*(2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g)));let m=Math.round(100*d)/100;return console.log("distancew误差",m),m};
