A Flash Developer Resource Site

# Thread: atan return value in degrees

1. hi there,

i want to calculate the sides of a triangle using the atan function but it return strange values ?!

the flash help says concerning atan:
Method; computes and returns the arc tangent for the number specified in the parameter x. The return value is between negative pi divided by 2, and positive pi divided by 2.

why is that, can somebody help me to compute the value in degrees?

i know that this might possibly be a stupid question in a math forum but i´m new to trigonometry and any help is very much appreciated!
thanks, niko

2. Code:
```y = (y2-y1);
x = (x2-x1);
r = Math.atan2(y, x);
angle = ((r/Math.PI)*180)-90;```
the angle (in degrees) of the line drawn between (x1,y1) and (x2,y2)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap

Click Here to Expand Forum to Full Width