isAngleInsideRadiansSelection function

bool isAngleInsideRadiansSelection(
  1. double angle,
  2. double start,
  3. double sweep,
  4. ClockIncrementTimeFormat clockIncrementTimeFormat,
)

Implementation

bool isAngleInsideRadiansSelection(
  double angle,
  double start,
  double sweep,
  ClockIncrementTimeFormat clockIncrementTimeFormat,
) {
  var normalized = angle > pi / 2
      ? clockIncrementTimeFormat.value * pi / 2 - angle
      : pi / 2 - angle;
  var end = (start + sweep) % (2 * pi);
  return end > start
      ? normalized > start && normalized < end
      : normalized > start || normalized < end;
}