Closed marcluque closed 4 months ago
@marcluque You're right. This function needs a bit of cleaning. The tests are comparing it with the Numpy arctan2 so the output should be between -pi and pi.
@christophe0606 thank you for checking and giving the confirmation!
Documentation improved.
I was going over the atan2 documentation, but couldn't find any indication of the radian range that is used. Can somebody help me determine this? I tried going over the code, but it doesn't seem obvious to me what value range can be expected. I'm thinking that it is
(-Pi, Pi]
, but it would be great to have that confirmed. Would also be great if the documentation foratan2
could be updated with the expected range.While going over the atan2 code, I noticed that the implementation slightly deviates from an exemplary definition given on Wikipedia. In particular, this line does not seem to be "correct", since the case is never possible for
q15_t
. It seems like this code might have been taken from the floating point implementation where this distinction makes sense. Another thing hinting at this is this line.