calculatePerimeter method

double calculatePerimeter(
  1. double width,
  2. double height
)

计算椭圆周长

Implementation

double calculatePerimeter(double width, double height) {
  // 椭圆周长公式:L=2πb+4(a-b)
  var a = width;
  // var a = width * 0.8;
  var b = height;
  return 2 * pi * b + 4 * (a - b);
}