isPointInside method

bool isPointInside(
  1. LatLng point
)

Checks if a point is inside the given Circle

final Circle circle = new Circle(new LatLng(0.0,0.0), 111319.0);
final LatLng newPos = new LatLng(1.0,0.0);

expect(circle.isPointInside(newPos),isTrue);

final Circle circle2 = new Circle(new LatLng(0.0,0.0), 111318.0);

expect(circle2.isPointInside(newPos),isFalse);

Implementation

bool isPointInside(final LatLng point) {
    Validate.notNull(point);

    final Distance distance = new Distance(calculator: _calculator);

    final double dist = distance(center, point);
    return dist <= radius;
}