isPointInsideOval method

bool isPointInsideOval(
  1. Offset ovalCenter,
  2. double semiMajorAxis,
  3. double semiMinorAxis
)

Implementation

bool isPointInsideOval(
    Offset ovalCenter, double semiMajorAxis, double semiMinorAxis) {
  double xTerm = (dx - ovalCenter.dx) / semiMajorAxis;
  double yTerm = (dy - ovalCenter.dy) / semiMinorAxis;

  return (xTerm * xTerm + yTerm * yTerm) <= 1;
}