Hallo Melody,
my english is not so good, but i start.
We have a Point P, the coordinate is ( x,y ). So we have P(x,y).
The question is, what is the angle from the x-axis to that Point (we call the angle also polar angle ). See: https://en.wikipedia.org/wiki/Polar_coordinate_system
The formula for the angular coordinate is :
But this formula does not calculate the angle correctly. We have the same angle in the Quadrant ( I and III ) and in the Quadrant ( II and IV ).
Why?
Because and
If we divide y by x, the information about the quadrant has disappeared.
But we can see:
We must correct the angular coordinate afterwards.
and if y or x is zero, we must put constants:
We have succeed, there is a function which takes this work from us!
The funktion is atan2
and needs two parametres
The new formula for the angular coordinate is :