isInHalfPlane static method

bool isInHalfPlane(
  1. int quad,
  2. int halfPlane
)

Returns whether the given quadrant lies within the given halfplane (specified by its right-hand quadrant).

Implementation

static bool isInHalfPlane(int quad, int halfPlane) {
  if (halfPlane == SE) {
    return quad == SE || quad == SW;
  }
  return quad == halfPlane || quad == halfPlane + 1;
}