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) num
Returns the angle between two LatLngs, in radians. This is the same as the distance on the unit sphere.
computeArea(List<Point<num>> path) num
Returns the area of a closed path on Earth.
computeDistanceBetween(Point<num> from, Point<num> to) num
Returns the distance between two LatLngs, in meters.
computeDistanceFromListOfPoints(List<Point<num>> points) num
Returns the distance summed from all LatLng points, in meters
computeHeading(Point<num> from, Point<num> to) num
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) num
Returns the length of the given path, in meters, on Earth.
computeOffset(Point<num> from, num distance, num 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, num distance, num 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) 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.
computeSignedAreaTest(List<Point<num>> path, num radius) num
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(num lat1, num lng1, num lat2, num lng2) num
Returns distance on the unit sphere; the arguments are in radians.
getCardinal(num angle) String
see: https://stackoverflow.com/a/25867068/3182210
interpolate(Point<num> from, Point<num> to, num fraction) Point<num>
Returns the Point which lies the given fraction of the way between the origin Point and the destination Point.
polarTriangleArea(num tan1, num lng1, num tan2, num lng2) num
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(num x, num y, num 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) num
toRadians(num deg) num
Missing simple conversions from Math class Code from: https://github.com/dart-lang/sdk/issues/4211#issue-84512743
toSubBounds(GMULatLngBounds bounds, {int division = 2}) List<GMULatLngBounds>
Splits Bound to smaller bounds equivalent of number of division^2