|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.AndrewGray.geoutils.GreatCircle
implements various mathematical methods related to Great Circle calculations.
Great Circles are the shortest paths between locations. As such they represent
the ideal course for such applications as aircraft and ocean navigation.
On a typical Great Circle track the bearing varies constantly. Constant true
courses are Rhumb lines
Note: All methods in this class assume the Earth is a perfect sphere of
6371km radius. In fact the equatorial radius is about 30Km greater than the polar.
RhumbLine| Inner Class Summary | |
class |
GreatCircle.DistanceTooLargeException
thrown by applyBearingAndDistance and getTrack if the specified distance is larger than Math.PI/4 (~5000km) |
| Constructor Summary | |
GreatCircle()
Creates a new Great Circle object |
|
| Method Summary | |
LatLong |
applyBearingAndDistance(LatLong origin,
double bearing,
double km)
compute destination LatLong given origin, bearing and distance. |
double |
getBearing(LatLong origin,
LatLong destination)
Calculate the initial bearing between two points on a great circle. |
int |
getDatelineTraversalID()
Returns the id of point last computed by getTrack() which crosses Longitude 180 degrees. |
double |
getDistance(LatLong origin,
LatLong destination)
Method to compute Great Circle distance between two points. |
double |
getEarthRadius()
Get the current radius of the Earth used in calculation |
LatLong |
getIntersection(LatLong ll1,
double bearing1,
LatLong ll2,
double bearing2)
Computes the LatLong of the intersection of two great circles given both origin LatLongs and initial bearings. |
LatLong[] |
getTrack(LatLong origin,
LatLong destination,
double kmIncTarget)
Computes a track between two points given KM distance between waypoints. |
void |
setEarthRadius(double radius)
Set the radius of the Earth for calculations that involve it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GreatCircle()
| Method Detail |
public double getDistance(LatLong origin,
LatLong destination)
origin - LatLong representing start point of this GreatCircledestination - LatLong representing end point of this GreatCircle
public double getBearing(LatLong origin,
LatLong destination)
This is the initial bearing which should be taken from
origin to begin the Great Circle track. On most Great Circles the
bearing varies continuously thoughout the track.
This is not the Direction between locations in the truest
sense of the world.For the constant true bearing
use the corresponding RhumbLine routine.
origin - LatLong representing start point of this GreatCircledestination - LatLong representing end point of this GreatCircleRhumbLine,
RhumbLine.getBearing(LatLong,LatLong)
public LatLong applyBearingAndDistance(LatLong origin,
double bearing,
double km)
throws GreatCircle.DistanceTooLargeException
origin - LatLong representing start point of this GreatCirclebearing - Course taken from origin - in radiansdistance - Distance to travel along given bearing - km.DistanceTooLarge - if the supplied distance is greater that PI/4 (~5000km)
public LatLong[] getTrack(LatLong origin,
LatLong destination,
double kmIncTarget)
throws GreatCircle.DistanceTooLargeException
In the demonstration applet this method is used for the map plot of the Great Circle course between the two selected points.
On a Great Circle route the course normally constantly changes throughout the journey. Traditionally ocean navigators recalculated their course every 12 hours whilst the auto-pilots on modern aircraft do so continously.
This method uses the parameter kmIncTarget as the target distance between course recomputations. This is only a target distance as the concept of way points inherently increases the overall total distance travelled beyond that of an perfect Great Circle course..
The demonstration applet uses a kmIncTarget value of 200 which has been found to add less than 2% to most great circle routes.
origin - Start point on the Great Circledestination - End point on the Great CirclekmIncTarget - Target distance in KM between waypoints.getDatelineTraversalID()public int getDatelineTraversalID()
public void setEarthRadius(double radius)
radius - the new earth radius in KMpublic double getEarthRadius()
public LatLong getIntersection(LatLong ll1,
double bearing1,
LatLong ll2,
double bearing2)
ll1 - LatLong representing the origin of the first Great Circlebearing1 - the initial bearing in radians of the first Great Circlell2 - LatLong representing the origin of the second Great Circlebearing2 - the initial bearing in radians of the second Great Circle
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||