### trigonometry

#### Arctan > 1 newbie question

```It has been quite some time since I've had to compute the theta of an angle. But given a right angle:
|
|
b |
-----------------
a
I'm trying to compute theta (the slope of the angle). My understanding of trigonometry (as rusty as it is) is that theta = arctan(b/a). So if b = 50 and a = 1811. Then using the windows calculator, 50 / 1811 = 0.027609055770292655991165102153506. Therefore the arctan(b/a) = 1.5814806205083755492980816356377. If my math is correct, how do I translate this value into the slope of the angle? It should be around 30-40 degrees, right?
```
```atan2(y, x)
will return you the angle in radians (and successfully cope with the cases where x and/or y are 0).
To convert to degrees apply the following formula:
double degrees = radians * (180 / PI)
Where PI is 3.141592... or math.pi in c#
```
```If you use a C dialect then there a useful function for just this purpose
atan2(y, x);```

### Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App