1. ## arc tan function

I want to do the formula A= arc tan (b/c).

I'm not sure on the formula in VB. Qbasic says: atn(tan(pi/4).
If that is it, where do I put my answer from b/c?

The VB Atn function returns radians. Pi radians equals 180 degrees. Note that arctan(infinity) = 90 degrees or Pi/2 radians. You have to worry about the quotient you are using.

You need code something like the following.
Code:
```Public Const Pi As Double = 3.14159 26535 89793
Dim AngleDegrees As Double
Dim Rise As Double 'Y coordinate or side opposite angle
Dim Run As Double 'X coordinate or side adjacent to angle

'Rise & Run could be sides of a right triangle, not the hypotenuse
'Rise and Run could be XY-coordinates.

AngleDegrees = AngleRadians * 180 / Pi```
For most of my applications, I use two functions which I call Latitude and Longitude. Each accepts Rise and Run as arguments and returns an angle in radians.

Longitude always returns an angle in the range zero to 2*Pi (0 to 360 degrees), while Latitude returns an angle in the range Plus Pi/2 to minus Pi/2 (Plus 90 to minus 90 degrees).

Internally, the functions take into account the signs of Rise & Run, and avoid division by zero when Run = zero.

#### Posting Permissions

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

Featured