Quote:Original post by ilmarinen
Bearing:
0 -> You're heading north
+pi/2 -> You're heading west
-pi/2 -> You're heading east
(+/-)pi -> You're heading south
Hmmm, my bearings range from 0->2pi, and they seem to work based on my tests (a bearing of pi/2 is east, a bearing of 3pi/2 is west), but otherwise I am set up the way you describe. My latitudes run from pi/2 (North pole) to -pi/2 (south pole) with 0 at the equator. My longitudes run from 0 to 2pi. And everything seems to go the right direction when I run them through the equations :)
You guys have convinced me that nothing is wrong, I freaked out over nothing, heh. Thanks.
One last question before I put this to bed. From time to time I get a value out of range. For the most part, the equations handle wrapping on their own, but every once in a while I get a result for the end longitude that is over 2pi. For example, this one:
Start Lat: 1.29554
Start Long: 4.95131
Bearing: 0
Distance: 50
End Lat: 1.53925
End Long: 8.0929
This seems to happen only when I start or end near the north pole (south pole doesn't seem to have the same problem). Is this just a rounding issue? Do you think I can just do a -2pi on the value and call it good if it ends up out of range?
So far I haven't been able to get the latitude to go out of range, or the longitude to go below range, only over it. But it may be I haven't tested it enough to hit those cases.