|
||||||||||
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.AndoyerCalculator
public class AndoyerCalculator
A geographic data calculator based on the Andoyer formula. This is a good algorithm which takes into account the flattening of the Earth. Accuracy should be around the flattening squared; however, some extreme cases can yield bad results.
Note that currently we only have the Andoyer algorithm for distance; other functions use simpler spherical methods. Hence, this class should be used for reasonably fast but fairly accurate distance calculations, where edge cases (e.g. near-antipodean points) are not encountered.
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 | |
---|---|
AndoyerCalculator()
Create a calculator using the default ellipsoid. |
|
AndoyerCalculator(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 AndoyerCalculator()
public AndoyerCalculator(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)
NOTE: this is the Haversine version of this algorithm.
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)
NOTE: this is the Haversine version of this algorithm.
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)
NOTE: this is the Haversine version of this algorithm.
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 |