<p>I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians.</p>

<p>I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypotenuse and therefore the variable angle of var z?  A solution in either AS3 or psuedocode would be very helpful. Thanks.</p>

<p><img src="https://i.stack.imgur.com/B0nfz.jpg" alt="triangle"></p>

z is equivalent to 180 - angle of yH. Or:
```
```
180 - arctan(x/y) //Degrees
pi - arctan(x/y) //radians
```
```
Also, if actionscript's math libraries have it, use arctan2, which takes both the x and y and deals with signs correctly.