public class DistanceCalculationHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM Copyright notice field.
|
Modifier and Type | Method and Description |
---|---|
static double | convertDoubleKilometersToMiles(double anKilometerValue)
Returns the miles equivalent of the kilometer value
|
static double | convertDoubleMilesToKilometers(double aMileValue)
Returns the kilometer equivalent of the mile value
|
static float | convertFloatKilometersToMiles(float anKilometerValue)
Returns the miles equivalent of the kilometer value
|
static float | convertfloatMilesToKilometers(float aMileValue)
Returns the kilometer equivalent of the mile value
|
static double | degreesToRadians(double anDegrees)
Converts a numeric representation of degrees to its equivalent in radians.
|
protected static double | get1DegreeLongitude(PhysicalStoreGeoCodeType aCenterGeoCode)
Add 1% to the approximation to create a slightly larger range.
|
static double | getDistanceBetweenGeoCodes(PhysicalStoreGeoCodeType aGeoCode1, PhysicalStoreGeoCodeType aGeoCode2)
Returns the distance between the two geographical codes in kilometers Based on the great circle distance formula variant: distance(lat1, long1, lat2, long2) = 2R*sin^-1(sqrt(sin^2((lat1-lat2)/2) + (cos(lat1)*cos(lat2)*sin^2((long1-long2)/2)))) Where all latitudes and longitudes are assumed to be radians.
|
static PhysicalStoreGeoCodeType | getNorthWestGeoCode(PhysicalStoreGeoCodeType aCenterGeoCode, double anRadius)
Gets the north-west boundary of the range of geographical codes to search
|
static PhysicalStoreGeoCodeType | getSouthEastGeoCode(PhysicalStoreGeoCodeType aCenterGeoCode, double anRadius)
Gets the south-east boundary of the range of geographical codes to search
|
static double | radiansToDegrees(double anRadians)
Converts a numeric representation of radians to its equivalent in degrees.
|
public static final java.lang.String COPYRIGHT
public static double getDistanceBetweenGeoCodes(PhysicalStoreGeoCodeType aGeoCode1, PhysicalStoreGeoCodeType aGeoCode2)
public static double convertDoubleKilometersToMiles(double anKilometerValue)
public static double convertDoubleMilesToKilometers(double aMileValue)
public static float convertFloatKilometersToMiles(float anKilometerValue)
public static float convertfloatMilesToKilometers(float aMileValue)
public static PhysicalStoreGeoCodeType getNorthWestGeoCode(PhysicalStoreGeoCodeType aCenterGeoCode, double anRadius)
public static PhysicalStoreGeoCodeType getSouthEastGeoCode(PhysicalStoreGeoCodeType aCenterGeoCode, double anRadius)
public static double degreesToRadians(double anDegrees)
public static double radiansToDegrees(double anRadians)
protected static double get1DegreeLongitude(PhysicalStoreGeoCodeType aCenterGeoCode)