Oh i see! But in this case what should i use as second parameter of the function? Atan2 looks like it needs 2 parameters.

Yes, that's why you need it, you are performing a catesian to polar coordinate transform and you need to

know the signs of both axes to get the angle right for all 360 degrees.

So for instance on the xy-plane you'd call atan2 (y, x) to get the mathematical angle.

Review coordinate transforms:

polar coords (r, theta). x = r cos(theta), y = r sin(theta), thus tan(theta) = y/x.

But note that tan(theta) repeats every 180 degrees, not every 360, so it loses vital information.

cartesian coords (x, y). r = sqrt(x^2+y^2), theta = atan2(y, x)

Note that atan2 sees the signs of both x and y and can reconstruct the correct angle always,

and doesn't blow up if x = 0, which atan(y/x) would.