public class LatLong extends JavascriptObject
Modifier and Type | Field and Description |
---|---|
static double |
EarthRadiusMeters |
jsObject, objectCounter, peerRegistry, runtime, variableName
Constructor and Description |
---|
LatLong(double latitude,
double longitude) |
LatLong(netscape.javascript.JSObject jsObject) |
Modifier and Type | Method and Description |
---|---|
double |
distanceFrom(LatLong end)
From v3_epoly.js, calculates the distance between this LatLong point and
another.
|
double |
getBearing(LatLong end)
Calculates the bearing, in degrees, of the end LatLong point from this
LatLong point.
|
LatLong |
getDestinationPoint(double bearing,
double distance)
Calculates the LatLong position of the end point of a line the specified
distance from this LatLong, along the provided bearing, where North is 0,
East is 90 etc.
|
double |
getLatitude() |
double |
getLongitude() |
double |
latToRadians()
Convenience method to convert the latitude of this LatLong to radians.
|
double |
longToRadians()
Convenience method to convert the longitude of this LatLong to radians.
|
String |
toString() |
checkBoolean, checkInteger, checkUndefined, getJSObject, getNextVariableName, getProperty, getProperty, getVariableName, invokeJavascript, invokeJavascript, invokeJavascriptReturnValue, invokeJavascriptReturnValue, isMemberDefined, setProperty, setProperty, setProperty
public static final double EarthRadiusMeters
public LatLong(double latitude, double longitude)
public LatLong(netscape.javascript.JSObject jsObject)
public double getLatitude()
public double getLongitude()
public double distanceFrom(LatLong end)
end
- The end point to calculate the distance to.public double latToRadians()
public double longToRadians()
public LatLong getDestinationPoint(double bearing, double distance)
bearing
- The bearing, in degrees, with North as 0, East as 90 etc.distance
- The distance in metres.public double getBearing(LatLong end)
end
- The point that the bearing is calculated for.Copyright © 2016. All Rights Reserved.