Example #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));
        }
Example #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);
        }