public final class CosineDistance extends Object implements DistanceMeasure
This distance measure is computationally much less expensive than the spherical distance, because it is not necessary to evaluate the inverse of the cosine.
Constructor and Description |
---|
CosineDistance(double lon,
double lat)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(double lon,
double lat)
Returns the distance of a given (lon, lat) point to
the reference (lon, lat) point.
|
public CosineDistance(double lon, double lat)
lon
- The reference longitude of this distance calculator.lat
- The reference latitude of this distance calculator.public double distance(double lon, double lat)
distance
in interface DistanceMeasure
lon
- The longitude.lat
- The latitude.Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.