Returns every Nth point.
static List<double> nth(List<double> data, int threshold) { final indices = nthIndices(data, threshold); return [for (final i in indices) data[i]]; }