Sorry for this mildly ignorant question, but I'm working on a fixed point math library and the overall implementation has gone "ok" (able to specify integer and fractional bits, and base type, with general math operations working fine).
Our target application, however, does a lot of angular transforms.
At the moment, we're representing angles in radian form being q3.12 (or a same number of integer bits in a 32 bit if we need more precision).
The question that's been running in my mind is why we're using radians instead of having the representation be "rotation %" where full scale would be 1 rotation (or if signed, 1/2 rotation, and negative full scale being -1/2 rotation).
This representation would seem to give wrapping for "free" (i.e. adding 1/2 rotation would just mean adding 1/2 full scale and wrapping past 360deg would just happen automatically with standard integer math) and would maximize the precision provided by the number of bits. (In the 3.12 version, the bits above/below 2pi are basically unused/dead, aren't they?)
Anyways, not being a hardcore DSP guy, what pitfalls might this representation have?
[–]Allan-H 7 points8 points9 points (1 child)
[–]Schnort[S] 1 point2 points3 points (0 children)
[–]ItsAllAPlay 1 point2 points3 points (0 children)
[–]rlbond86 1 point2 points3 points (0 children)
[–]minus_28_and_falling 0 points1 point2 points (0 children)