SphericalUtils class

Spherical geometry utilities (distances, headings, areas, offsets, interpolation), ported from the android-maps-utils SphericalUtil 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(GoogleMapsUtilsLatLngBounds gmuLatLngBounds) Point<double>
Returns the center point of the given gmuLatLngBounds.
computeAngleBetween(Point<double> from, Point<double> to) double
Returns the angle between from and to, in radians. This is the same as the distance on the unit sphere.
computeArea(List<Point<double>> path) double
Returns the area of a closed path on Earth, in square meters.
computeDistanceBetween(Point<double> from, Point<double> to) double
Returns the distance between from and to, in meters.
computeHeading(Point<double> from, Point<double> to) double
Returns the heading from from to to. Headings are expressed in degrees clockwise from North within the range [-180, 180).
computeLength(List<Point<double>> path) double
Returns the length of the given path, in meters, on Earth.
computeOffset(Point<double> from, double distance, double heading) Point<double>
Returns the point resulting from moving distance meters from from in the specified heading (degrees clockwise from north).
computeOffsetOrigin(Point<double> to, double distance, double heading) Point<double>?
Returns the origin when provided with a destination to, distance in meters, and original heading. Returns null when no solution exists.
computeSignedArea(List<Point<double>> 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<double>> 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.
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
Returns a 16-point compass cardinal abbreviation for the given angle.
interpolate(Point<double> from, Point<double> to, double fraction) Point<double>
Returns the point which lies the given fraction of the way between from and to.
toBounds(double x, double y, double radiusInMeters) GoogleMapsUtilsLatLngBounds
Creates a bounding box centered at (x, y) with a given radiusInMeters.
toBoundsFromPoints(List<Point<double>> points) GoogleMapsUtilsLatLngBounds
Computes the smallest bounding box that contains all points.
toDegrees(double rad) double
Converts rad radians to degrees.
toRadians(double deg) double
Converts deg degrees to radians.
toSubBounds(GoogleMapsUtilsLatLngBounds bounds, {int division = 2}) List<GoogleMapsUtilsLatLngBounds>
Splits bounds into smaller sub-bounds. The number of resulting bounds equals division².