I want to get a simple solution to calculate the angle of a line (like a pointer of a clock).
I have 2 points:
cX, cY - the center of the line.
eX, e
You find here two formulas ,one from positive axis x and anticlockwise
and one from the north and clockwise.
There is x=x2-x1 and y=y2=y1 .There is E=E2-E1 and N=N2-N1.
The formulas are working for any value of x,y, E and N.
For x=y=0 or E=N=0 the result is undefined.
f(x,y)=pi()-pi()/2*(1+sign(x))*(1-sign(y^2))
-pi()/4*(2+sign(x))*sign(y)
-sign(x*y)*atan((abs(x)-abs(y))/(abs(x)+abs(y)))
f(E,N)=pi()-pi()/2*(1+sign(N))*(1-sign(E^2))
-pi()/4*(2+sign(N))*sign(E)
-sign(E*N)*atan((abs(N)-abs(E))/(abs(N)+abs(E)))