Ujjwalsharma2210 / flutter_map_math

Find all map related calculations you might need for your flutter application here
MIT License
5 stars 3 forks source link

bearingBetween returns wrong value #3

Open familan opened 2 months ago

familan commented 2 months ago

bearingBetween() converts the incoming lats and lons to radians using degreesToRadians() for use in computing the y and x values, so re-applying it in the next to last line: var angle = degreesToRadians(atan2(y, x)); doesn't make any sense. Since the last line: return (angle + 360) % 360; is obviously handling degrees, it seems: var angle = radiansToDegrees(atan2(y, x)); would be correct.

Ujjwalsharma2210 commented 2 months ago

It would be very helpful if you could solve this issue and create a pull request. I am not actively maintaining this project. Thanks for the input.