ERXGMapUtilities.Coordinate Class Reference

List of all members.

Public Member Functions

 Coordinate (double latitude, double longitude)
double distanceTo (Coordinate other, char unit)
double latitude ()
double longitude ()
String toString ()

Static Public Member Functions

static double distance (double lat1, double lon1, double lat2, double lon2, char unit)

Static Public Attributes

static final char UNIT_KILOMETERS = 'K'
static final char UNIT_NAUTICAL_MILES = 'N'
static final char UNIT_STATUTE_MILES = 'M'

Static Private Member Functions

static double deg2rad (double deg)
static double rad2deg (double rad)

Private Attributes

double latitude
double longitude


Constructor & Destructor Documentation

Coordinate ( double  latitude,
double  longitude 
)


Member Function Documentation

static double deg2rad ( double  deg  )  [static, private]

static double distance ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
char  unit 
) [static]

Calculate distance between two coordinates.

South latitudes are negative, east longitudes are positive.

Based on code from http://www.zipcodeworld.com/developers.htm

Parameters:
lat1 Latitude of point 1 (in decimal degrees)
lon1 Longitude of point 1 (in decimal degrees)
lat2 Latitude of point 2 (in decimal degrees)
lon2 Longitude of point 2 (in decimal degrees)
unit one of UNIT_STATUTE_MILES, UNIT_NAUTICAL_MILES or UNIT_KILOMETERS
Returns:
distance between the two coordinates

double distanceTo ( Coordinate  other,
char  unit 
)

double latitude (  ) 

double longitude (  ) 

static double rad2deg ( double  rad  )  [static, private]

String toString (  ) 


Member Data Documentation

double latitude [private]

double longitude [private]

final char UNIT_KILOMETERS = 'K' [static]

final char UNIT_NAUTICAL_MILES = 'N' [static]

final char UNIT_STATUTE_MILES = 'M' [static]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:04 2012 for Project Wonder by  doxygen 1.5.8