pointInArea method

  1. @override
bool pointInArea(
  1. Point point
)
override

A raycast checks if the point is inside the convexHullPoints.

Implementation

@override
bool pointInArea(Point point) {
  //Raycasting the convex hull
  bool inside = false;

  int iterations = convexHullPoints!.length;
  for (int i = 0; i < iterations; i++) {
    if (_intersectsWithEdge(convexHullPoints![i],
        convexHullPoints![(i + 1) % iterations], point)) {
      inside = !inside;
    }
  }

  return inside;
}