From dac4146f33dff19bd4d058308adaf60b5ad2a0d8 Mon Sep 17 00:00:00 2001 From: YaFedImYaEatIm Date: Wed, 14 Sep 2016 08:23:30 +1200 Subject: [PATCH 1/7] Added calculate Distance() --- src/main/java/seng202/group9/Core/Airport.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/seng202/group9/Core/Airport.java b/src/main/java/seng202/group9/Core/Airport.java index 5b0b9e5..5de5e4d 100644 --- a/src/main/java/seng202/group9/Core/Airport.java +++ b/src/main/java/seng202/group9/Core/Airport.java @@ -289,6 +289,21 @@ public class Airport { public void delArrivalRoutes(int index){ arrivalRoutes.remove(index); } + + /** + * Calculates the distance between this airport and another airport in kilometers. + * @param airport + * @return + */ + public double calculateDistance(Airport airport){ + double distance = 0; + double dLong = this.longitude - airport.getLatitude(); + double dLat = this.latitude - airport.getLatitude(); + double a = Math.pow((Math.sin(dLat/2)), 2) + Math.cos(this.latitude) * Math.cos(airport.getLatitude()) * Math.pow(Math.sin(dLong/2), 2); + double c = a * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); + distance = 6371 * c; + return distance; + } /** * Information of the airport returned in String format. */ From b6624f20a841c045f6ceb627de0265cffce0cad9 Mon Sep 17 00:00:00 2001 From: Liam Beckett Date: Wed, 14 Sep 2016 08:29:01 +1200 Subject: [PATCH 2/7] Updated the Flight Summary GUI --- src/main/resources/flight_data_summary.fxml | 83 ++++++++++++++------- 1 file changed, 54 insertions(+), 29 deletions(-) diff --git a/src/main/resources/flight_data_summary.fxml b/src/main/resources/flight_data_summary.fxml index d880b41..49698b1 100644 --- a/src/main/resources/flight_data_summary.fxml +++ b/src/main/resources/flight_data_summary.fxml @@ -4,10 +4,11 @@ - - + + + @@ -17,77 +18,101 @@ - + - + + + + + + + + + + - + + + + + + + + + - + + + + + + - + - + - - - - - - + - - + + + + + + + + + - + - - - - + + + + + + + + +