This is basic trigonometry used in a display. Normally you'd learn this in high school, but it is very useful in programming.