From 7397659d3a9062c902513f71e1ba2a8f75c6ff92 Mon Sep 17 00:00:00 2001 From: Mike Barry Date: Tue, 3 Dec 2024 06:58:26 -0500 Subject: [PATCH] fix cosine --- .../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; }