parameterize slope segment function

This commit is contained in:
vcoppe
2024-09-16 13:52:41 +02:00
parent 1b741c3b2f
commit 4ebf2b6fa9

View File

@@ -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