|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.geo.GeoCalculator
org.hermit.geo.HaversineCalculator
public class HaversineCalculator
A geographic data calculator based on the Haversine formula. This is a fast algorithm which is based on a spherical approximation of the Earth. This should give an accuracy within 0.5% or so.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.hermit.geo.GeoCalculator |
---|
GeoCalculator.Algorithm |
Nested classes/interfaces inherited from interface org.hermit.geo.GeoConstants |
---|
GeoConstants.Ellipsoid |
Field Summary |
---|
Fields inherited from interface org.hermit.geo.GeoConstants |
---|
EQUATORIAL_RADIUS, MEAN_RADIUS, POLAR_RADIUS |
Constructor Summary | |
---|---|
HaversineCalculator()
Create a calculator using the default ellipsoid. |
|
HaversineCalculator(GeoConstants.Ellipsoid ellip)
Create a calculator using a given ellipsoid. |
Method Summary | |
---|---|
Azimuth |
azimuth(Position p1,
Position p2)
Calculate the azimuth (bearing) from a position to another. |
Distance |
distance(Position p1,
Position p2)
Calculate the distance between two positions. |
GeoCalculator.Algorithm |
getAlgorithm()
Get the algorithm this calculator uses. |
Distance |
latDistance(Position p1,
double lat)
Calculate the distance between a position and a given latitude. |
Position |
offset(Position p1,
Distance distance,
Azimuth azimuth)
Calculate a second position given its offset from a given position. |
Vector |
vector(Position p1,
Position p2)
Calculate the azimuth and distance from a position to another. |
Methods inherited from class org.hermit.geo.GeoCalculator |
---|
getCalculator, getCurrentAlgorithm, setAlgorithm, setAlgorithm |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HaversineCalculator()
public HaversineCalculator(GeoConstants.Ellipsoid ellip)
ellip
- The ellipsoid to use for geodetic calculations.Method Detail |
---|
public GeoCalculator.Algorithm getAlgorithm()
getAlgorithm
in class GeoCalculator
public Distance distance(Position p1, Position p2)
distance
in class GeoCalculator
p1
- Position to calculate the distance from.p2
- Position to calculate the distance to.
public Distance latDistance(Position p1, double lat)
latDistance
in class GeoCalculator
p1
- Position to calculate the distance from.lat
- Latitude in radians to calculate the distance to.
public Azimuth azimuth(Position p1, Position p2)
azimuth
in class GeoCalculator
p1
- Position to calculate the distance from.p2
- Position to calculate the distance to.
public Vector vector(Position p1, Position p2)
vector
in class GeoCalculator
p1
- Position to calculate the vector from.p2
- Position to calculate the vector to.
public Position offset(Position p1, Distance distance, Azimuth azimuth)
offset
in class GeoCalculator
p1
- Position to calculate from.distance
- The Distance to the desired position.azimuth
- The Azimuth to the desired position.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |