Ejemplo n.º 1
0
        public static decimal FindDistance(Planet departure, Planet destination)
        {
            decimal distance = (Decimal)Math.Sqrt(Math.Pow(Math.Abs((double)departure.CoordX - (double)destination.CoordX), 2) + Math.Pow(Math.Abs((double)departure.CoordY - (double)destination.CoordY), 2));

            return(distance);
        }
Ejemplo n.º 2
0
 public FlightPath(Planet departure, Planet destination)
 {
     DepartureId   = departure.PlanetID;
     DestinationId = destination.PlanetID;
     Distance      = FindDistance(departure, destination);
 }