perimeter property

  1. @override
double get perimeter
override

The total length of the shape's boundary.

Implementation

@override
double get perimeter {
  // Ramanujan's approximation for the circumference of an ellipse.
  final a = semiMajorAxis;
  final b = semiMinorAxis;
  final h = math.pow((a - b) / (a + b), 2);
  return math.pi * (a + b) * (1 + (3 * h) / (10 + math.sqrt(4 - 3 * h)));
}