Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I calculate acos in vb? 1

Status
Not open for further replies.

navyguy

Mechanical
Aug 13, 2002
5
0
0
US
I have an equation to be calculated in vb that requires me to calculate the acos of a value. There doesn't seem to appear to be an acos function in vb. I heard you can do some trick with atan. Does anyone know that trick or have any suggestions?

Thanks
 
Replies continue below

Recommended for you

Two ways:

1. If your VBA code is for an excel application, use
application.acos(angle)
With the "application" in front, VBA will reckognize the excel functions.

2. If not, derive function via atn() as described in the VBAhelp (browse for help on cos, and press "see also"):


Derived Math Functions

The following is a list of nonintrinsic math functions that can be derived from the intrinsic math functions:

Function Derived equivalents
......
Inverse Cosine Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
......

Hope this helps

Regards
Mogens
 
Status
Not open for further replies.
Back
Top