ellipseEstimated function

List<PointD> ellipseEstimated(
  1. double x,
  2. double y,
  3. DrawConfig config,
  4. EllipseParams ellipseParams,
)

Implementation

List<PointD> ellipseEstimated(
    double x, double y, DrawConfig config, EllipseParams ellipseParams) {
  final List<PointD> corePoints = [];
  final double radOffset = config.offsetSymmetric(0.5) - pi / 2;
  for (double angle = radOffset;
      angle < (pi * 2 + radOffset - 0.01);
      angle = angle + ellipseParams.increment!) {
    final PointD p = PointD(
      config.offsetSymmetric(1) + x + ellipseParams.rx! * cos(angle),
      config.offsetSymmetric(1) + y + ellipseParams.ry! * sin(angle),
    );
    corePoints.add(p);
  }
  return corePoints;
}