Skip to content
New issue

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

TurfMeasurements should have a function for determining bearing deltas #1264

Open
kmadsen opened this issue Jun 7, 2021 · 1 comment
Open

Comments

@kmadsen
Copy link
Contributor

kmadsen commented Jun 7, 2021

TurfMeasurement.bearing(Point point1, Point point2

This function can return -180.0, 180.0.

In order to calculate the difference between two bearings. Downstream needs to create a normalizing function which can determine that the difference between -179.0 and 179.0, is 2 degrees.

double TurfMeasurements.shortestBearingDiff(double bearing1, double bearing2) {
  ...
}

This function should be proven with unit tests.

@kmadsen
Copy link
Contributor Author

kmadsen commented Jun 7, 2021

other name ideas for the function. i like extending the bearing function with bearingShortest*. am not preferring "rotationDiff" because rotation is a difference.

bearingDifference
bearingShortestDiff
bearingShortestDelta
shortestRotationDiff

@kmadsen kmadsen changed the title TurfMeasurements should have shortestBearingDiff for negative bearing handling TurfMeasurements should have function for determining bearing deltas Jun 7, 2021
@kmadsen kmadsen changed the title TurfMeasurements should have function for determining bearing deltas TurfMeasurements should have a function for determining bearing deltas Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants