SphericalUtils class

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

centerFromLatLngBounds(GMULatLngBounds gmuLatLngBounds) Point<num>
Calculate the center of the boundaries to a Point in latitude and longitude
computeAngleBetween(Point<num> from, Point<num> to) double
Returns the angle between two LatLngs, in radians. This is the same as the distance on the unit sphere.
computeArea(List<Point<num>> path) double
Returns the area of a closed path on Earth.
computeDistanceBetween(Point<num> from, Point<num> to) double
Returns the distance between two LatLngs, in meters.
computeDistanceFromListOfPoints(List<Point<num>> points) double
Returns the distance summed from all LatLng points, in meters
computeHeading(Point<num> from, Point<num> to) double
Returns the heading from one Point to another Point. Headings are expressed in degrees clockwise from North within the range [-180,180).
computeLength(List<Point<num>> path) double
Returns the length of the given path, in meters, on Earth.
computeOffset(Point<num> from, double distance, double heading) Point<num>
Returns the Point resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north).
computeOffsetOrigin(Point<num> to, double distance, double heading) Point<num>?
Returns the location of origin when provided with a Point destination, meters travelled and original heading. Headings are expressed in degrees clockwise from North. This function returns null when no solution is available.
computeSignedArea(List<Point<num>> path) double
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.
computeSignedAreaTest(List<Point<num>> path, double radius) double
Returns the signed area of a closed path on a sphere of given radius. The computed area uses the same units as the radius squared. Used by SphericalUtilTest.
distanceRadians(double lat1, double lng1, double lat2, double lng2) double
Returns distance on the unit sphere; the arguments are in radians.
getCardinal(double angle) String
see: https://stackoverflow.com/a/25867068/3182210
interpolate(Point<num> from, Point<num> to, double fraction) Point<num>
Returns the Point which lies the given fraction of the way between the origin Point and the destination Point.
polarTriangleArea(double tan1, double lng1, double tan2, double lng2) double
Returns the signed area of a triangle which has North Pole as a vertex. Formula derived from 'Area of a spherical triangle given two edges and the included angle' as per 'Spherical Trigonometry' by Todhunter, page 71, section 103, point 2.
toBounds(double x, double y, double radiusInMeters) GMULatLngBounds
see: https://stackoverflow.com/a/31029389/3182210
toBoundsFromPoints(List<Point<num>> points) GMULatLngBounds
Convert a list of latitudes and longitudes to an object of boundaries
toDegrees(num rad) double
toRadians(num deg) double
Missing simple conversions from Math class Code from: https://github.com/dart-lang/sdk/issues/4211#issue-84512743