kopia lustrzana https://github.com/onthegomap/planetiler
fix cosine (#1125)
rodzic
87c658fe4a
commit
fd7b79a374
|
@ -155,7 +155,7 @@ public class VWSimplifier extends GeometryTransformer implements Function<Geomet
|
|||
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;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue