Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-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

*Tek-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


How do you write functions acs(arc cos) and asn(arc sin)

How do you write functions acs(arc cos) and asn(arc sin)

How do you write functions acs(arc cos) and asn(arc sin)

Could anyone please tell me how to write qbasic functions acs(arc cos) and asn(arc sin), and to input arguments for the functions via the keyboard. Th results should be in

RE: How do you write functions acs(arc cos) and asn(arc sin)

You can create piecewise-defined functions (which can be represented in QB with a simple IF statement) for these using ATN (the arc of tangent function), which is the only inverse trig function built into QB. Just remember that cos^2(x) + sin^2(x) = 1. With this, you can take a cosine value and get one of the two possible sine values back, or a sine value and get one of the possible cosine values, either of which will give you a ratio that you can put into ATN() and get an angle back (in radians). Then, it's up to you to determine what quadrant that angle is in and transform in accordingly. Arcsin and arctan are always in the 1st or 4th quadrant, and Arccos is always in the 1st or 2nd quadrant. Here are sketches of the functions:

                   ^y        **********
                   |  *******
          *******  |
**********         |


(-1, 2pi)
    *    ^y
    *    |
     *   |
      ** |
  (0, pi)| **
         |   *
         |    *(1, 0)

           (-1, pi)
         ^y   *
         |    *
         |   *
    (0,0)| **
      ** |
     *   |
    *    |
    *    |
(1,-pi)  |

The latter two graphs show the ENTIRE function. The range of the functions is as implied by the endpoints. As for the graph of arctan, it has the same range as arcsin, but its domain is the reals.

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 Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

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

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

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close