aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/geofence/GeofenceCircle.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/geofence/GeofenceCircle.java b/src/org/traccar/geofence/GeofenceCircle.java
index d78734714..f6fca63ca 100644
--- a/src/org/traccar/geofence/GeofenceCircle.java
+++ b/src/org/traccar/geofence/GeofenceCircle.java
@@ -39,9 +39,13 @@ public class GeofenceCircle extends GeofenceGeometry {
this.radius = radius;
}
+ public double distanceFromCenter(double latitude, double longitude) {
+ return DistanceCalculator.distance(centerLatitude, centerLongitude, latitude, longitude);
+ }
+
@Override
public boolean containsPoint(double latitude, double longitude) {
- return DistanceCalculator.distance(centerLatitude, centerLongitude, latitude, longitude) <= radius;
+ return distanceFromCenter(latitude, longitude) <= radius;
}
@Override