antenna: (fixes #889) Improve WrapTo* functions
- Test inputs around the lower and the upper bounds for WrapTo180, WrapTo360, WrapToPi, and WrapTo2Pi.
- Re-implement these 4 functions with one inline function
WrapToRange
.
WrapToRange
increases the input angle with the length of the interval,
i.e., upperBound - lowerBound
. As a result, the significant digits that
makes a + upperBound - lowerBound == upperBound - lowerBound
will be
dropped due to the float pointing error, before entering the first branch.
Edited by Ben Lee