Ejemplo n.º 1
0
        public static double GetDistance(double fromLat, double fromLng, double toLat, double toLng)
        {
            Point ptFrom = Context.MakePoint(fromLng, fromLat);
            Point ptTo   = Context.MakePoint(toLng, toLat);

            return(Context.GetDistCalc().Distance(ptFrom, ptTo));
        }
Ejemplo n.º 2
0
        public static double GetDistance(double fromLat, double fromLng, double toLat, double toLng)
        {
            Point ptFrom   = Context.MakePoint(fromLng, fromLat);
            Point ptTo     = Context.MakePoint(toLng, toLat);
            var   distance = Context.GetDistCalc().Distance(ptFrom, ptTo);

            return((distance / RadiansToDegrees) * EarthMeanRadiusKm);
        }