Interface DistanceCalculator
- All Known Implementing Classes:
AbstractDistanceCalculator
,CartesianDistCalc
,GeodesicSphereDistCalc
,GeodesicSphereDistCalc.Haversine
,GeodesicSphereDistCalc.LawOfCosines
,GeodesicSphereDistCalc.Vincenty
public interface DistanceCalculator
Performs calculations relating to distance, such as the distance between a pair of points. A
calculator might be based on Euclidean space, or a spherical model, or theoretically something
else like an ellipsoid.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
double
calcBoxByDistFromPt
(Point from, double distDEG, SpatialContext ctx, Rectangle reuse) Calculates the bounding box of a circle, as specified by its center point and distance.double
calcBoxByDistFromPt_yHorizAxisDEG
(Point from, double distDEG, SpatialContext ctx) TheY
coordinate of the horizontal axis of a circle that has maximum width.double
The distance betweenfrom
andPoint(toX,toY)
.double
The distance betweenfrom
andto
.pointOnBearing
(Point from, double distDEG, double bearingDEG, SpatialContext ctx, Point reuse) Calculates where a destination point is given an origin (from
) distance, and bearing (given in degrees -- 0-360).boolean
Returns true if the distance between from and to is <= distance.
-
Method Details
-
distance
The distance betweenfrom
andto
. -
distance
The distance betweenfrom
andPoint(toX,toY)
. -
within
Returns true if the distance between from and to is <= distance. -
pointOnBearing
Point pointOnBearing(Point from, double distDEG, double bearingDEG, SpatialContext ctx, Point reuse) Calculates where a destination point is given an origin (from
) distance, and bearing (given in degrees -- 0-360). If reuse is given, then this method may reset() it and return it. -
calcBoxByDistFromPt
Calculates the bounding box of a circle, as specified by its center point and distance. -
calcBoxByDistFromPt_yHorizAxisDEG
TheY
coordinate of the horizontal axis of a circle that has maximum width. On a 2D plane, this result is alwaysfrom.getY()
but, perhaps surprisingly, on a sphere it is going to be slightly different. -
area
-
area
-