speed up wpt to segment matching

This commit is contained in:
vcoppe
2025-12-24 12:43:24 +01:00
parent a6a3917986
commit 2e171dfbee
3 changed files with 77 additions and 60 deletions

View File

@@ -59,13 +59,13 @@ function ramerDouglasPeuckerRecursive(
}
export function crossarcDistance(
point1: TrackPoint,
point2: TrackPoint,
point1: TrackPoint | Coordinates,
point2: TrackPoint | Coordinates,
point3: TrackPoint | Coordinates
): number {
return crossarc(
point1.getCoordinates(),
point2.getCoordinates(),
point1 instanceof TrackPoint ? point1.getCoordinates() : point1,
point2 instanceof TrackPoint ? point2.getCoordinates() : point2,
point3 instanceof TrackPoint ? point3.getCoordinates() : point3
);
}