Skip to content

Commit

Permalink
Make [0.0, 360.0) heading clamp more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
tcobbs-bentley committed Mar 29, 2024
1 parent d71d0d8 commit 0513074
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,12 @@ class ITMGeolocationManager(private var context: Context) {
}

private fun clampHeading(heading: Double?): Double? = if (heading != null) {
(heading + 360.0) % 360.0
val clamp = heading % 360.0
if (clamp < 0.0) {
clamp + 360.0
} else {
clamp
}
} else {
null
}
Expand Down

0 comments on commit 0513074

Please sign in to comment.