public class GeographicalDistance extends DistanceFunction
DDD.MM
where DDD
are the degrees and MM
are the minutes. Positive values indicate
north/east and negative values indicate south/west. The resulting distances
are in kilometers.Constructor and Description |
---|
GeographicalDistance()
Constructs a new geographical distance function.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(int length,
double[] position1,
double[] position2)
Calculates and returns the distance between the two positions.
|
static double |
toGeographical(double x)
Converts a latitude or longitude value in the form
DDD.MM to its
geographical angle in radians. |
distance
public GeographicalDistance()
public static double toGeographical(double x)
DDD.MM
to its
geographical angle in radians.x
- the latitude or longitude value in the form DDD.MM
public double distance(int length, double[] position1, double[] position2)
IllegalArgumentException
if any
preconditions fail.distance
in class DistanceFunction
length
- the length (or dimension) of the two positionsposition1
- the position of the first nodeposition2
- the position of the second nodeIllegalArgumentException
- if the nodes are not two dimensionalCopyright © 2016. All rights reserved.