Skip to content

Commit fd7b79a

Browse files
authored
fix cosine (#1125)
1 parent 87c658f commit fd7b79a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

planetiler-core/src/main/java/com/onthegomap/planetiler/geo/VWSimplifier.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private static double cos(double ax, double ay, double bx, double by, double cx,
155155
double den = Math.hypot(bx - ax, by - ay) * Math.hypot(cx - bx, cy - by),
156156
cos = 0;
157157
if (den > 0) {
158-
cos = Math.clamp((ax - bx) * (cx - bx) + (ay - by) * (cy - by) / den, -1, 1);
158+
cos = Math.clamp(((ax - bx) * (cx - bx) + (ay - by) * (cy - by)) / den, -1, 1);
159159
}
160160
return cos;
161161
}

0 commit comments

Comments
 (0)