A formula to convert a counter-clockwise angle to clockwise angle with an offset

If $\theta$ is your original angle, then $(-\theta + 90^{\circ}) \bmod 360^{\circ}$ will work. The negative on $\theta$ deals with the fact that we are changing from counterclockwise to clockwise. The $+90^{\circ}$ deals with the offset of ninety degrees. And lastly we need to mod by $360^{\circ}$ to keep our angle in the desired range $[0^{\circ},360^{\circ}]$.


A formula that you are asking:

$E=E_2-E_1$ and $N=N_2-N_1$, and is working for any value of $E$ and $N$.

$$f(E,N)=\pi-\frac{\pi}{2} \left(1+\text{sign }N\right) (1-\text{sign }E^2)-\frac{\pi}{4} \left(2+\text{sign }N\right) \text{sign }E -\text{sign } (N E) \ \text{atan }\frac{\lvert N\rvert-\lvert E\rvert}{\lvert N\rvert+\lvert E\rvert}$$

The formula gives a clockwise angle from $0$-north to $2\pi$.