getVerticalLine function

List<List<double>> getVerticalLine(
  1. List<List<double>> points
)

Implementation

List<List<double>> getVerticalLine(List<List<double>> points) {
  for (int i = 0, j = 1; j < points.length; i++, j++) {
    final p1 = points[i], p2 = points[j];
    if (p1[0] == p2[0]) return [p1, p2];
  }
  return [];
}