SphericalUtil class
Port of SphericalUtil from android-maps-utils (https://github.com/googlemaps/android-maps-utils)
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
computeAngleBetween(
LatLng from, LatLng to) → num - Returns the angle between two LatLngs, in radians. This is the same as the distance on the unit sphere.
-
computeArea(
List< LatLng> path) → num - Returns the area of a closed path on Earth. @param path A closed path. @return The path's area in square meters.
-
computeDistanceBetween(
LatLng from, LatLng to) → num - Returns the distance between two LatLngs, in meters.
-
computeHeading(
LatLng from, LatLng to) → num - Returns the heading from one LatLng to another LatLng. Headings are expressed in degrees clockwise from North within the range [-180,180). @return The heading in degrees clockwise from north.
-
computeLength(
List< LatLng> path) → num - Returns the length of the given path, in meters, on Earth.
-
computeOffset(
LatLng from, num distance, num heading) → LatLng - Returns the LatLng resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north). @param from The LatLng from which to start. @param distance The distance to travel. @param heading The heading in degrees clockwise from north.
-
computeOffsetOrigin(
LatLng to, num distance, num heading) → LatLng? - Returns the location of origin when provided with a LatLng destination, meters travelled and original heading. Headings are expressed in degrees clockwise from North. This function returns null when no solution is available. @param to The destination LatLng. @param distance The distance travelled, in meters. @param heading The heading in degrees clockwise from north.
-
computeSignedArea(
List< LatLng> path) → num - Returns the signed area of a closed path on Earth. The sign of the area may be used to determine the orientation of the path. "inside" is the surface that does not contain the South Pole. @param path A closed path. @return The loop's area in square meters.
-
distanceRadians(
num lat1, num lng1, num lat2, num lng2) → num - Returns distance on the unit sphere; the arguments are in radians.
-
interpolate(
LatLng from, LatLng to, num fraction) → LatLng - Returns the LatLng which lies the given fraction of the way between the origin LatLng and the destination LatLng. @param from The LatLng from which to start. @param to The LatLng toward which to travel. @param fraction A fraction of the distance to travel. @return The interpolated LatLng.
Constants
- earthRadius → const num