I am using dspic libq library to experiment with Q15 functions. The difficulty I am facing is that _Q15sinPI() and _Q15cosPI return in range -32768 to +32767 corresponding to -pi to +pi. But _Q15atanYByXByPI() deals only on -45 to +45 degrees and returns-8192 to +8192. This gives me only solutions to first and 4th quadrant. How do derive the arc tan for 2nd and 3rd quadrant?
The restriction is necessary due to Q15 number range. You get +/- 45..90 degree range by flipping x and y. Other two quadrants by manipulating x and y sign.