In almost every programming language there some sort of math module with various trigonometric functions including functions called atan and atan2. atan(x,y) Now everybody knows atan, it’s just inverse tangent,… Read more »