length property
Total length of the polyline (sum of all segment lengths)
Implementation
double get length {
double total = 0;
for (int i = 0; i < points.length - 1; i++) {
total += points[i].distanceTo(points[i + 1]);
}
return total;
}
Total length of the polyline (sum of all segment lengths)
double get length {
double total = 0;
for (int i = 0; i < points.length - 1; i++) {
total += points[i].distanceTo(points[i + 1]);
}
return total;
}