com.AndrewGray.geoutils
Class RhumbLine

java.lang.Object
  |
  +--com.AndrewGray.geoutils.RhumbLine

public class RhumbLine
extends java.lang.Object

Collection of algorithms related to Rhumb line (constant true bearing) calculations.

Rhumb lines are tracks of constant bearing. Contrast this with Great Circles where the bearing constantly varies. It would be possible to travel between two locations using a constant bearing but the distance would usually be greater than that of a Great Circle route.

One example of the use of a Rhumb line;
When praying Muslims should face Mecca. In order to calculate the direction they must face at any given location they should use the Rhumb Line bearing algorithm. The Great Circle bearing will yield the initial path on the shortest route but the Rhumb line bearing is the true direction to Mecca.
Disclaimer & Warranty
The software is supplied as-is. No warranty, or statement of fitness of purpose is given.

All emphasis is on the user to verify values. In particular, this software should not be used for safety critical applications such as navigation, aeronautics, etc.

In obtaining this software you agree that liability of the copyright holder for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the software be limited to the purchase cost thereof. This includes but is not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the software to operate with any other software, even if such holder or other party has been advised of the possibility of such damages.

Copyright © 2004 by Andrew Gray

Author:
Andrew Gray
See Also:
GreatCircle

Constructor Summary
RhumbLine()
          Create a new RhumbLine object
 
Method Summary
 LatLong applyBearingAndDistance(LatLong origin, double bearing, double km)
          compute destination LatLong given an origin, bearing and km distance
 double getBearing(LatLong origin, LatLong destination)
          compute the rhumb line course (constant true course) between two LatLongs.
 double getDistance(LatLong origin, LatLong destination)
          compute the rhumb line distance (constant true course) between two LatLongs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RhumbLine

public RhumbLine()
Create a new RhumbLine object
Method Detail

getBearing

public double getBearing(LatLong origin,
                         LatLong destination)
compute the rhumb line course (constant true course) between two LatLongs. This is the Direction between locations as most people understand it.

Parameters:
ll1 - LatLong of origin
ll2 - LatLong of destination
Returns:
bearing in radians of the rhumb line course

getDistance

public double getDistance(LatLong origin,
                          LatLong destination)
compute the rhumb line distance (constant true course) between two LatLongs.
Parameters:
ll1 - LatLong of origin
ll2 - LatLong of destination
Returns:
distance in kilometers of the rhumb line course

applyBearingAndDistance

public LatLong applyBearingAndDistance(LatLong origin,
                                       double bearing,
                                       double km)
compute destination LatLong given an origin, bearing and km distance
Parameters:
origin - the start point of this rhumb line
bearing - the constant true course of this rhumb
km - the KM distance to travel