public class SphericalUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static double |
computeArea(java.util.List<LatLng> path)
Returns the area of a closed path on Earth.
|
static double |
computeDistanceBetween(LatLng from,
LatLng to)
Returns the distance between two LatLngs, in meters.
|
static double |
computeHeading(LatLng from,
LatLng to)
Returns the heading from one LatLng to another LatLng.
|
static double |
computeLength(java.util.List<LatLng> path)
Returns the length of the given path, in meters, on Earth.
|
static LatLng |
computeOffset(LatLng from,
double distance,
double heading)
Returns the LatLng resulting from moving a distance from an origin
in the specified heading (expressed in degrees clockwise from north).
|
static LatLng |
computeOffsetOrigin(LatLng to,
double distance,
double heading)
Returns the location of origin when provided with a LatLng destination,
meters travelled and original heading.
|
static double |
computeSignedArea(java.util.List<LatLng> path)
Returns the signed area of a closed path on Earth.
|
static LatLng |
interpolate(LatLng from,
LatLng to,
double fraction)
Returns the LatLng which lies the given fraction of the way between the
origin LatLng and the destination LatLng.
|
public static double computeHeading(LatLng from, LatLng to)
public static LatLng computeOffset(LatLng from, double distance, double heading)
from
- The LatLng from which to start.distance
- The distance to travel.heading
- The heading in degrees clockwise from north.public static LatLng computeOffsetOrigin(LatLng to, double distance, double heading)
to
- The destination LatLng.distance
- The distance travelled, in meters.heading
- The heading in degrees clockwise from north.public static LatLng interpolate(LatLng from, LatLng to, double fraction)
from
- The LatLng from which to start.to
- The LatLng toward which to travel.fraction
- A fraction of the distance to travel.public static double computeDistanceBetween(LatLng from, LatLng to)
public static double computeLength(java.util.List<LatLng> path)
public static double computeArea(java.util.List<LatLng> path)
path
- A closed path.public static double computeSignedArea(java.util.List<LatLng> path)
path
- A closed path.