SphericalUtil

open class SphericalUtil

Functions

Link copied to clipboard
open fun computeArea(@NonNull path: List<LatLng>): Double
Returns the area of a closed path on Earth.
Link copied to clipboard
open fun computeDistanceBetween(@NonNull from: LatLng, @NonNull to: LatLng): Double
Returns the distance between two LatLngs, in meters.
Link copied to clipboard
open fun computeHeading(@NonNull from: LatLng, @NonNull to: LatLng): Double
Returns the heading from one LatLng to another LatLng.
Link copied to clipboard
open fun computeLength(@NonNull path: List<LatLng>): Double
Returns the length of the given path, in meters, on Earth.
Link copied to clipboard
@NonNull
open fun computeOffset(    @NonNull from: LatLng,     distance: Double,     heading: Double): LatLng
Returns the LatLng resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north).
Link copied to clipboard
@Nullable
open fun computeOffsetOrigin(    @NonNull to: LatLng,     distance: Double,     heading: Double): LatLng
Returns the location of origin when provided with a LatLng destination, meters travelled and original heading.
Link copied to clipboard
open fun computeSignedArea(@NonNull path: List<LatLng>): Double
Returns the signed area of a closed path on Earth.
Link copied to clipboard
open fun distanceRadians(    lat1: Double,     lng1: Double,     lat2: Double,     lng2: Double): Double
Returns distance on the unit sphere; the arguments are in radians.
Link copied to clipboard
open fun distanceTo(@NonNull from: LatLng, @NonNull to: LatLng): Double
Computes the distance between the given coordinates, in meters
Link copied to clipboard
@NonNull
open fun fastComputeOffset(    @NonNull from: LatLng,     distanceX: Double,     distanceY: Double): LatLng
Returns the LatLng resulting from moving a distance from an origin
Link copied to clipboard
@NonNull
open fun interpolate(    @NonNull from: LatLng,     @NonNull to: LatLng,     fraction: Double): LatLng
Returns the LatLng which lies the given fraction of the way between the origin LatLng and the destination LatLng.