diff --git a/lib/src/longitude_and_latitude_calculator_base.dart b/lib/src/longitude_and_latitude_calculator_base.dart index 7260bd0..ee75ffc 100644 --- a/lib/src/longitude_and_latitude_calculator_base.dart +++ b/lib/src/longitude_and_latitude_calculator_base.dart @@ -3,20 +3,20 @@ import 'dart:math' show cos, sqrt, asin; /// Checks if you are awesome. Spoiler: you are. class LonAndLatDistance { - - - double lonAndLatDistance ({double lat1 = 34.052235,double lon1 = -118.243683,double lat2 = 40.754932,double lon2 = -73.984016,bool km = false}){ + double lonAndLatDistance( + {double lat1 = 34.052235, + double lon1 = -118.243683, + double lat2 = 40.754932, + double lon2 = -73.984016, + bool km = false}) { var p = 0.017453292519943295; - var a = 0.5 - cos((lat2 - lat1) * p)/2 + - cos(lat1 * p) * cos(lat2 * p) * - (1 - cos((lon2 - lon1) * p))/2; + var a = 0.5 - + cos((lat2 - lat1) * p) / 2 + + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2; if (km == true) { return 12742 * asin(sqrt(a)); } else { return (12742 * asin(sqrt(a))) * 0.621371; } } - - - } diff --git a/test/longitude_and_latitude_calculator_test.dart b/test/longitude_and_latitude_calculator_test.dart index 95c4747..1728011 100644 --- a/test/longitude_and_latitude_calculator_test.dart +++ b/test/longitude_and_latitude_calculator_test.dart @@ -17,7 +17,6 @@ void main() { lon2: -73.984016, km: false); expect(miles, 2446.519306778203); - }); }); }