예제 #1
0
파일: Program.cs 프로젝트: fcnatra/coord
        private GeoDistance GetGeoDistance(GeoCoordinate geoCoordinateFrom, GeoCoordinate geoCoordinateTo)
        {
            var distanceInLatAxel  = GetDistance(geoCoordinateFrom, new GeoCoordinate(geoCoordinateTo.Latitude, geoCoordinateFrom.Longitude));
            var distanceInLontAxel = GetDistance(geoCoordinateFrom, new GeoCoordinate(geoCoordinateFrom.Latitude, geoCoordinateTo.Longitude));

            var geoDistance = GeoDistance.From(geoCoordinateTo);

            geoDistance.LatAxel  = distanceInLatAxel;
            geoDistance.LongAxel = distanceInLontAxel;

            return(geoDistance);
        }
예제 #2
0
파일: Program.cs 프로젝트: fcnatra/coord
        private const float EARTH_RADIUS = 6378.0f;//6367.45f; //

        public RunCalculation(string[] args)
        {
            GeoCoordinate geoCoordinate    = new GeoCoordinate(args[0], args[1]);
            var           quadrantSizeInKm = int.Parse(args[2]);

            double distanceKm = GetDistance(new GeoCoordinate(0, 0), geoCoordinate);

            Console.WriteLine($"Distance between points: {distanceKm}Km");

            GeoDistance geoDistanceInKm = GetGeoDistance(new GeoCoordinate(0, 0), geoCoordinate);

            Console.WriteLine($"\nDistance in Lat axel (Y): {geoDistanceInKm.LatAxel}Km");
            Console.WriteLine($"Distance in Lon axel (X): {geoDistanceInKm.LongAxel}Km");
        }