У меня есть велокомпьютер, регистрирующий каждую секунду, как далеко я зашел
Упрощенная версия данных выглядит так:
public class TrackPoint
{
public virtual Guid Id { get; set; } = Guid.NewGuid();
public virtual DateTime Time { get; set; }
public virtual double DistanceMeters { get; set; }
}
var trackPointList = new List<TrackPoint>
{
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:48"), DistanceMeters = 3.8099999427795410},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:49"), DistanceMeters = 7.7600002288818359},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:50"), DistanceMeters = 12.3299999237060547},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:51"), DistanceMeters = 18.0000000000000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:52"), DistanceMeters = 24.8999996185302734},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:53"), DistanceMeters = 32.1599998474121094},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:54"), DistanceMeters = 40.7200012207031250},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:55"), DistanceMeters = 49.7599983215332031},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:57"), DistanceMeters = 68.6100006103515625},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:17:58"), DistanceMeters = 79.3199996948242188},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:18:00"), DistanceMeters = 100.1900024414062500},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:18:02"), DistanceMeters = 122.7099990844726563},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:18:03"), DistanceMeters = 134.1900024414062500},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:18:04"), DistanceMeters = 145.9199981689453125},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:18:05"), DistanceMeters = 158.4700012207031250},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:04"), DistanceMeters = 5003.4101562500000000}, //5000 meters driven
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:05"), DistanceMeters = 5018.7797851562500000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:06"), DistanceMeters = 5034.0498046875000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:07"), DistanceMeters = 5048.8901367187500000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:08"), DistanceMeters = 5063.8798828125000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:09"), DistanceMeters = 5079.0200195312500000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:13"), DistanceMeters = 5141.0600585937500000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:17"), DistanceMeters = 5201.7500000000000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:21"), DistanceMeters = 5261.8798828125000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:23"), DistanceMeters = 5290.2900390625000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:28"), DistanceMeters = 5363.7099609375000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:33"), DistanceMeters = 5435.9101562500000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:34"), DistanceMeters = 5450.8901367187500000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:35"), DistanceMeters = 5465.4199218750000000},
new TrackPoint {Time = DateTime.Parse("2018-08-10 07:24:36"), DistanceMeters = 5480.5400390625000000},
};
Я бы хотел найти рекорд ближайших 5000 метров до
Приложение построено с использованием .net CORE 2.0 с использованием Visual Studio 2019.