Point.list constructor

Point.list(
  1. List<double> l
)

Factory constructor which reads x-y-z-values from a list

Implementation

factory Point.list(List<double> l) {
  int length = l.length;
  assert(length == 2 || length == 3, 'Point must have 2 or 3 dimensions');

  if (length == 2) {
    return Point._(l[0], l[1], 0);
  }

  return Point._(l[0], l[1], l[2]);
}