how did you figure it out?
the sticks values return the x and y vectors of the stick and there respective magnitude.
atan2 converts vectors to an angle
angle(x,y,x,y) is atan2 pretty much.
when you get to know constructs in's and out's this stuff will come to you in no time