From 3473ef343aa78e633f8200a6ecb627fc82ae15f3 Mon Sep 17 00:00:00 2001 From: Robert-0410 <62630290+Robert-0410@users.noreply.github.com> Date: Tue, 8 Oct 2024 03:10:34 -0700 Subject: [PATCH] Small improvement to the pi approximation (#1292) --- app/src/main/java/com/geeksville/mesh/util/LocationUtils.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/util/LocationUtils.kt b/app/src/main/java/com/geeksville/mesh/util/LocationUtils.kt index 8fef9c51..21f56c65 100644 --- a/app/src/main/java/com/geeksville/mesh/util/LocationUtils.kt +++ b/app/src/main/java/com/geeksville/mesh/util/LocationUtils.kt @@ -14,6 +14,7 @@ import kotlin.math.cos import kotlin.math.log2 import kotlin.math.pow import kotlin.math.sin +import kotlin.math.PI /******************************************************************************* * Revive some of my old Gaggle source code... @@ -181,7 +182,7 @@ fun latLongToMeter( lat_b: Double, lng_b: Double ): Double { - val pk = (180 / 3.14169) + val pk = (180 / PI) val a1 = lat_a / pk val a2 = lng_a / pk val b1 = lat_b / pk