We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plotting this as lines on Mapbox, I need to calculate a second LatLng coordinate for the line. One of the options is to do calculations using distance and bearing: https://stackoverflow.com/questions/7222382/get-lat-long-given-current-point-distance-and-bearing
Here is what I have tried (in Dart)
extension on num { num toDegrees() { return (this * 180 / PI); } } final toBearing = (num azimuthRad) { //rotating 90 degrees, because azimuth, in the docs is 0 at south //also making sure values are positive final azimuth = (azimuthRad.toDegrees() - 90) % 360; //converting depending on the quadrant if (azimuth > 0 && azimuth <= 90) return azimuth; if (azimuth > 90 && azimuth <= 180) return 180 - azimuth; if (azimuth > 180 && azimuth <= 270) return azimuth - 180; if (azimuth > 270 && azimuth <= 360) return 360 - azimuth; };
Plotted values at the moment are way off and I am not sure where I went wrong. Any ideas?
The text was updated successfully, but these errors were encountered:
Did you ever get anywhere with this? I'm currently trying to figure this out also
Sorry, something went wrong.
No, not really
No branches or pull requests
Plotting this as lines on Mapbox, I need to calculate a second LatLng coordinate for the line.
One of the options is to do calculations using distance and bearing: https://stackoverflow.com/questions/7222382/get-lat-long-given-current-point-distance-and-bearing
Here is what I have tried (in Dart)
Plotted values at the moment are way off and I am not sure where I went wrong. Any ideas?
The text was updated successfully, but these errors were encountered: