I need to calculate the angles of an right triangle with the sides: screenX = 1920
and screenY = 1080
.
How can i calculate the angles alpha and beta, assuming that gamma is 90° (right triangle).
I've tried it like this:
double alpha = Math.toDegrees(Math.atan(screenX/screenY));
double beta = Math.toDegrees(Math.atan((screenY/screenX)));
resulting in: alpha = 45.0 beta = 0.0
instead of the correct values: alpha = 60.65 beta = 29.35
.