What algorithm/formula can I use to calculate a LatLng point 5 meters closer to another LatLng point? I'm trying to write a function with 2 LatLng parameters and have it return a LatLng that is 5 meters from the first LatLng and in the direction of the second LatLng.
Have a look at Android Map Utils library, specifically the SphericalUtil class.
1.) Call the method computeHeading to obtain your heading from first to second
2.) Call the method computeOffset to solve for the location 5 meters from your first point
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With