approximateLength method

double approximateLength({
  1. int samples = 100,
})

Approximate total arc length by sampling.

Implementation

double approximateLength({int samples = 100}) {
  final pts = sample(samples);
  double total = 0;
  for (var i = 1; i < pts.length; i++) {
    total += pts[i - 1].distanceTo(pts[i]);
  }
  return total;
}