English: Atan2 function. On horizontal axis 0X there is complex argument of point of unit circle. It is measured (
principal value ) from 0 to 2pi ( modulo 2 pi).
On vertical axis 0Y ther is output of function atan2 :
where is a point of unit circle :
such
so
Atan2 function gives argument of complex number with principal value in range -pi to pi, , that is -π < atan2(y, x) ≤ π.
Such definition makes function single-valued, [1]
but creates discontinuity at angle pi.
Maxima source code
It uses gnuplot through Maxima
L(t):=exp(%i*t*2*%pi); /* unit circle parametrised with angle in turns */
plot2d(
[atan2(imagpart(L(x)),realpart(L(x)))],
[x,0,1],
[y,-2*%pi,2*%pi],
[plot_format, gnuplot],
[gnuplot_term,"png"],
[gnuplot_out_file, "atan2.png"],
[legend, "atan2"],
[xlabel,"angle in radians"],
[ylabel,"angle in radians"],
[gnuplot_preamble,"
set key left top;
set xtics ('pi/2' 0.25, 'pi' 0.5, '3pi/2' 0.75,'2pi' 1.0);
set ytics ('-2pi' -6.283, '-pi' -3.1415, '-pi/2' -1.5708, '0' 0, 'pi/2' 1.5708, 'pi' 3.1415, '2pi' 6.283);
set grid xtics ytics
"]
);
After plotting in Maxima vertical line was manually removed ( using image editor) and red circles was added.