
Jake Z. answered 05/06/19
Experienced TA & Tutor for Computer Science (Java/C/Python)
Java has a builtin function in the Math library called atan2() that does what you need. In this case, you'll want to make sure to subtract the y & x values as atan2() assumes you're starting from the origin. (Also note, it takes y 1st and then x)
Hope this helped!