static void Main(string[] args)
 {
     Location home = new Location(18.037986, 28.870097, Planet.Earth);
     Console.WriteLine(home);
     Location saturn = new Location(30, 40.89, Planet.Saturn);
     Console.WriteLine(saturn);
 }
        public double GetDistance(Location other)
        {
            var firstCordinate = new GeoCoordinate(this.Latitude, this.Longitude);
            var secondCordinate = new GeoCoordinate(other.Latitude, other.Longitude);

            double distance = firstCordinate.GetDistanceTo(secondCordinate);
            return distance;
        }
Exemplo n.º 3
0
        internal static void Main()
        {
            Location home = new Location(18.037986, 28.870097, Planet.Earth);
            Location partyPlace = new Location(25.42378, 75.53248, Planet.Uranus);

            double distance = home.GetDistance(partyPlace);

            Console.WriteLine("The distance between \n{0} and \n{1} \nis {2:F2}km", home, partyPlace, distance / 1000);
        }
        static void Main(string[] args)
        {
            Location earth = new Location(18.037986, 100.870097, Planet.Earth);
            Location mars = new Location(0.536512, 140.35469, Planet.Mars);
            Location jupiter = new Location(87.22156,-12.35662,Planet.Jupiter);
            Location saturn = new Location(64.123698,26.47589,Planet.Saturn);

            Console.WriteLine(earth);
            Console.WriteLine(mars);
            Console.WriteLine(jupiter);
            Console.WriteLine(saturn);

        }
Exemplo n.º 5
0
 static void Main(string[] args)
 {
     Location x = new Location(3,4,Planet.Earth);
     Console.WriteLine(x);
 }
Exemplo n.º 6
0
 static void Main()
 {
     var home = new Location(18.037986, 28.870097, Planet.Earth);
     Console.WriteLine(home);
 }