Point.vector constructor
Point.vector(
- Vector v
Factory constructor which reads x-y-z-values from a vector
Implementation
factory Point.vector(Vector v) {
int length = v.length;
assert(length == 2 || length == 3, 'Point must have 2 or 3 dimensions');
if (length == 2) {
return Point._(v[0], v[1], 0);
}
return Point._(v[0], v[1], v[2]);
}