> On 18 May 2021, at 20:30, Ben Bolker wrote:
>
> On my system (Ubuntu), 'man 3 catan' gives documentation on the function,
> and says "The real part of y is chosen in the interval [-pi/2,pi/2]" - but
> that _could_ be system-dependent.
My copy of "C in a Nutshell" suggests that this requi
Can you dig through into the code, see what's going on, and suggest a
documentation patch? To get you started, the code for the complex
version of atan2 is in
https://svn.r-project.org/R/trunk/src/main/complex.c
z_atan2 is at line 669 (the first argument is a pointer to the result,
args 2
The current documentation says that atan2(y,x) is the angle between the x-axis
and the vector from the origin to (x,y), but what does this mean when x & y are
complex? The function seems to pick theta with Re(theta) between -pi and pi and
with tan(theta) (approximately) equal to y/x, but that le