From 4ebf2b6fa9fac24258a6e8c154178ce43fd13e5e Mon Sep 17 00:00:00 2001 From: vcoppe Date: Mon, 16 Sep 2024 13:52:41 +0200 Subject: [PATCH] parameterize slope segment function --- gpx/src/gpx.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpx/src/gpx.ts b/gpx/src/gpx.ts index 1191a804..ff0eb264 100644 --- a/gpx/src/gpx.ts +++ b/gpx/src/gpx.ts @@ -806,7 +806,7 @@ export class TrackSegment extends GPXTreeLeaf { return distanceWindowSmoothingWithDistanceAccumulator(points, 50, (accumulated, start, end) => 100 * ((points[end].ele ?? 0) - (points[start].ele ?? 0)) / (accumulated > 0 ? accumulated : 1)); } - _computeSlopeSegments(statistics: GPXStatistics): [number[], number[]] { + _computeSlopeSegments(statistics: GPXStatistics, epsilon = 20): [number[], number[]] { // x-coordinates are given by: statistics.local.distance.total[point._data.index] * 1000 // y-coordinates are given by: point.ele // Compute the distance between point3 and the line defined by point1 and point2