From fd7b79a3747c6fae58771724f162883e2493396b Mon Sep 17 00:00:00 2001 From: Michael Barry Date: Tue, 3 Dec 2024 07:18:27 -0500 Subject: [PATCH] fix cosine (#1125) --- .../main/java/com/onthegomap/planetiler/geo/VWSimplifier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/geo/VWSimplifier.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/geo/VWSimplifier.java index 2972ce8f07..256d13f298 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/geo/VWSimplifier.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/geo/VWSimplifier.java @@ -155,7 +155,7 @@ private static double cos(double ax, double ay, double bx, double by, double cx, double den = Math.hypot(bx - ax, by - ay) * Math.hypot(cx - bx, cy - by), cos = 0; if (den > 0) { - cos = Math.clamp((ax - bx) * (cx - bx) + (ay - by) * (cy - by) / den, -1, 1); + cos = Math.clamp(((ax - bx) * (cx - bx) + (ay - by) * (cy - by)) / den, -1, 1); } return cos; }