One way to calculate the angles between points or vectors in different directions is to use the dot product and the cross product. The dot product can be used to compute the angle between two vectors, while the cross product can be used to determine the direction of the angle (i.e. clockwise or counterclockwise). Specifically, the cross product of two vectors can be used to compute a third vector that is perpendicular to both of the original vectors. If the resulting vector points in the same direction as the positive z-axis, then the angle between the two original vectors is counterclockwise, otherwise, it’s clockwise.
Another way is to use atan2, which is a variant of the arctangent function, that can determine the angle between two vectors in 2D space. It can distinguish between angles in the range of -180 and 180 degrees.
Check this thread out :