geo.google.datamodel
Class GeoUtils

java.lang.Object
  extended by geo.google.datamodel.GeoUtils

public class GeoUtils
extends Object


Method Summary
static double distanceBetweenInKm(GeoCoordinate c1, GeoCoordinate c2)
          Calculate the distance Between Geo Coordinates points in kilometers using spherical law of cosines formula.
static double distanceBetweenInMiles(GeoCoordinate c1, GeoCoordinate c2)
          Calculate the distance Between Geo Coordinates points in miles using spherical law of cosines formula.
static double haversineDistanceBetweenInKm(GeoCoordinate c1, GeoCoordinate c2)
          Calculate the distance Between Geo Coordinates points in kilimeters using Haversine formula.
static double haversineDistanceBetweenInMiles(GeoCoordinate c1, GeoCoordinate c2)
          Calculate the distance Between Geo Coordinates points in miles using Haversine formula.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

distanceBetweenInMiles

public static double distanceBetweenInMiles(GeoCoordinate c1,
                                            GeoCoordinate c2)
Calculate the distance Between Geo Coordinates points in miles using spherical law of cosines formula. http://mathworld.wolfram.com/SphericalTrigonometry.html

Returns:
distance between c1 and c2 in miles.

distanceBetweenInKm

public static double distanceBetweenInKm(GeoCoordinate c1,
                                         GeoCoordinate c2)
Calculate the distance Between Geo Coordinates points in kilometers using spherical law of cosines formula. http://mathworld.wolfram.com/SphericalTrigonometry.html

Returns:
distance between c1 and c2 in kilometers.

haversineDistanceBetweenInKm

public static double haversineDistanceBetweenInKm(GeoCoordinate c1,
                                                  GeoCoordinate c2)
Calculate the distance Between Geo Coordinates points in kilimeters using Haversine formula. Supposedly this formula has better precisions (need further investigations). However, it's a much slower function that the spherical law of cosines formula.
http://en.wikipedia.org/wiki/Haversine_formula

Returns:
distance between c1 and c2 in kilimeters.

haversineDistanceBetweenInMiles

public static double haversineDistanceBetweenInMiles(GeoCoordinate c1,
                                                     GeoCoordinate c2)
Calculate the distance Between Geo Coordinates points in miles using Haversine formula. Supposedly this formula has better precisions (need further investigations). However, it's a much slower function that the spherical law of cosines formula.
http://en.wikipedia.org/wiki/Haversine_formula

Returns:
distance between c1 and c2 in miles.


Copyright © 2008. All Rights Reserved.