From 6aa0e5dfccbd519c69fc1b25b06d6b5a4203f7e7 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 24 Jun 2019 12:10:49 +0100 Subject: [PATCH] Added unit information to qra.php library --- application/libraries/Qra.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/libraries/Qra.php b/application/libraries/Qra.php index 62ea3b6a..454b85ba 100644 --- a/application/libraries/Qra.php +++ b/application/libraries/Qra.php @@ -20,6 +20,15 @@ class Qra { } } + +/* + Info: Distance Function + + M = Miles + K = Kilometers + N = Nautical Miles +*/ + function distance($lat1, $lon1, $lat2, $lon2, $unit = 'M') { $theta = $lon1 - $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) *