Find robot heading angle to goal position [duplicate]

  angle, pygame, python, robot

I try to simulate a robot movement in pygame,
in my algorithm, I need to calculate robot to goal heading angle (angle between robot x_frame and a line that connects the robot to goal), and it’s important to know the sign of angle ( positive or negative). Pygame’s coordinate system is confusing because it mirrors y angle, but angles calculate like a normal coordinate system.

I have three point coordinate (shown in picture with green circle) and I want the angle between reed line and yellow line

Thanks for your help

enter image description here

Source: Python Questions