×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How do I calculate acos in vb?

How do I calculate acos in vb?

How do I calculate acos in vb?

(OP)
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

RE: How do I calculate acos in vb?

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

RE: How do I calculate acos in vb?

Just to add on

When x = 1, Arccos(x) = 0

When x = -1 Arccos (x) = 4 * Atn(1)

Regg

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources