There's 2 things I always remember from maths lessons at school
1. Don't offend the teacher by mentioning her hairy legs.
2. The 'SOH CAH TOA' rule
Sine(a)=Opposite/Hypotenuse
Cosine(a)=Adjacent/Hypotenuse
Tangent(a)= Opposite/Adjacent
Looking at your diagram,since you know x=adjacent, y=opposite, so you can calculate the tangent. From that, you can calculate the angle by using the inverse tangent function (also called arc tangent)
angle=atan(y/x);
Dunno what language you're using, but in C the atan() result is in radians, so you have to multiply the result by (180/PI) to convert to degrees.