From 12822a94d3fdcb7a7fa158246bc99763facad798 Mon Sep 17 00:00:00 2001 From: Manan Tilwani Date: Mon, 23 Mar 2026 18:17:31 +0530 Subject: [PATCH 1/2] Fix demonimator typo --- geodesy/lamberts_ellipsoidal_distance.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/geodesy/lamberts_ellipsoidal_distance.py b/geodesy/lamberts_ellipsoidal_distance.py index a5c43c5656e9..80234a973dcd 100644 --- a/geodesy/lamberts_ellipsoidal_distance.py +++ b/geodesy/lamberts_ellipsoidal_distance.py @@ -87,6 +87,7 @@ def lamberts_ellipsoidal_distance( # Compute central angle between two points # using haversine theta. sigma = haversine_distance / equatorial radius sigma = haversine_distance(lat1, lon1, lat2, lon2) / EQUATORIAL_RADIUS + # Intermediate P and Q values p_value = (b_lat1 + b_lat2) / 2 @@ -95,8 +96,8 @@ def lamberts_ellipsoidal_distance( # Intermediate X value # X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2) x_numerator = (sin(p_value) ** 2) * (cos(q_value) ** 2) - x_demonimator = cos(sigma / 2) ** 2 - x_value = (sigma - sin(sigma)) * (x_numerator / x_demonimator) + x_denominator = cos(sigma / 2) ** 2 + x_value = (sigma - sin(sigma)) * (x_numerator / x_denominator) # Intermediate Y value # Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2) @@ -106,6 +107,8 @@ def lamberts_ellipsoidal_distance( return EQUATORIAL_RADIUS * (sigma - ((flattening / 2) * (x_value + y_value))) +print(f"SF-Yosemite: {lamberts_ellipsoidal_distance(37.774856, -122.424227, 37.864742, -119.537521):0,.0f}") +print(f"Expected ~254km but got ???") if __name__ == "__main__": import doctest From 35dd8b2ab219c6f3c7b5bfe74fd7c9a6b149d390 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:29:06 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geodesy/lamberts_ellipsoidal_distance.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/geodesy/lamberts_ellipsoidal_distance.py b/geodesy/lamberts_ellipsoidal_distance.py index 80234a973dcd..4eb98bf2e1e1 100644 --- a/geodesy/lamberts_ellipsoidal_distance.py +++ b/geodesy/lamberts_ellipsoidal_distance.py @@ -87,7 +87,6 @@ def lamberts_ellipsoidal_distance( # Compute central angle between two points # using haversine theta. sigma = haversine_distance / equatorial radius sigma = haversine_distance(lat1, lon1, lat2, lon2) / EQUATORIAL_RADIUS - # Intermediate P and Q values p_value = (b_lat1 + b_lat2) / 2 @@ -107,8 +106,11 @@ def lamberts_ellipsoidal_distance( return EQUATORIAL_RADIUS * (sigma - ((flattening / 2) * (x_value + y_value))) -print(f"SF-Yosemite: {lamberts_ellipsoidal_distance(37.774856, -122.424227, 37.864742, -119.537521):0,.0f}") -print(f"Expected ~254km but got ???") + +print( + f"SF-Yosemite: {lamberts_ellipsoidal_distance(37.774856, -122.424227, 37.864742, -119.537521):0,.0f}" +) +print(f"Expected ~254km but got ???") if __name__ == "__main__": import doctest