au.cartertech.CalcClasses
Class DistanceCalculator
java.lang.Object
au.cartertech.CalcClasses.DistanceCalculator
public class DistanceCalculator
- extends java.lang.Object
Method Summary |
static double |
calculateDistance(GeoPoint startpt,
GeoPoint endpt)
Finds the distance between two points |
static double |
convertLatToDistance(int lat)
Converts the difference between two latitudes as a distance in kilometres
Android provides a method to get the latitude span of a map presently displayed on
screen, this method converts that span to kilometres |
static double |
convertLngToDistance(double lat,
int lngDist)
Converts the difference between two longitudes as a distance in kilometres
Android provides a method to get the longitude span of a map presently displayed on
screen, this method converts that span to kilometres |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistanceCalculator
public DistanceCalculator()
calculateDistance
public static double calculateDistance(GeoPoint startpt,
GeoPoint endpt)
- Finds the distance between two points
- Parameters:
startpt
- A GeoPoint containing the point to measure fromendpt
- A Geopoint containing the point to measure to
- Returns:
- The distance in kilometres between the two points
- See Also:
- com.google.android.maps.GeoPoint
convertLatToDistance
public static double convertLatToDistance(int lat)
- Converts the difference between two latitudes as a distance in kilometres
Android provides a method to get the latitude span of a map presently displayed on
screen, this method converts that span to kilometres
- Parameters:
lat
- The difference between two latitudes multiplied by 1,000,000 (the exact output of MapView.getLatitudeSpan())
- Returns:
- The latitude span in kilometres
- See Also:
- com.google.maps.MapView#getLatitudeSpan()
convertLngToDistance
public static double convertLngToDistance(double lat,
int lngDist)
- Converts the difference between two longitudes as a distance in kilometres
Android provides a method to get the longitude span of a map presently displayed on
screen, this method converts that span to kilometres
- Parameters:
lat
- The latitude at which the longitude range is calculatedlngDist
- The difference between two longitudes multiplied by 1,000,000 (the exact output of MapView.getLatitudeSpan())
- Returns:
- The longitude span in kilometres
- See Also:
- com.google.maps.MapView#getLongitudeSpan()