maps-utils-ktx / com.google.maps.android.ktx.utils / com.google.android.gms.maps.model.LatLng / computeSphericalOffsetOrigin

computeSphericalOffsetOrigin

fun LatLng.computeSphericalOffsetOrigin(distance: Double, heading: Double): LatLng?

Attempts to compute the origin LatLng from this LatLng where distance meters have been traveled with heading value heading.

Parameters

distance - the distance traveled from origin in meters

heading - the heading from origin to this LatLng (measured in degrees clockwise from North)

Return
the computed origin if a solution is available, otherwise, null

See Also

SphericalUtil.computeOffsetOrigin