dart-latlong icon indicating copy to clipboard operation
dart-latlong copied to clipboard

Bearing between two points

Open lukepighetti opened this issue 4 years ago • 2 comments

Is calculating the bearing between two points within scope of this library?

Is it implemented?

If not, is there a known algorithm that will accurately calculate the bearing between two points?

Use case: I'm standing at point A, what compass bearing should I use to walk in a straight line to reach point B?

lukepighetti avatar Oct 11 '21 18:10 lukepighetti

Like this? https://stackoverflow.com/a/54820295/884522

jifalops avatar May 21 '23 14:05 jifalops

@jifalops

I think he is searching for something like geolocator's bearingBetween method, to get the compass bearing of two lat/lng points. Here is a reference link to geolocator's solution:

https://github.com/Baseflow/flutter-geolocator/blob/ea54bac8dc5e5e05625658b739f95199113a36a5/geolocator_platform_interface/lib/src/geolocator_platform_interface.dart#L263

You could somewhat describe it as compass direction, but that's not really the correct wording here. :D

More sources and references:

  • https://en.wikipedia.org/wiki/Bearing_(angle)
  • https://www.nwcg.gov/course/ffm/location/61-bearing#:~:text=A%20bearing%20provides%20a%20direction,angle%20less%20than%2090%C2%B0.

Koboo avatar Feb 12 '24 07:02 Koboo