Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

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

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

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

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

akb (TechnicalUser) (OP)
23 Oct 00 8:19
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
radians.
logiclrd (Programmer)
6 Nov 00 2:51
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:

Arctan:
                   ^y        **********
                   |  *******
                   |**
-------------------*------------------>x
                 **|
          *******  |
**********         |

Arccos:

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

Arcsin:
           (-1, pi)
         ^y   *
         |    *
         |   *
    (0,0)| **
--------***--------->x
      ** |
     *   |
    *    |
    *    |
(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.

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!

Back To Forum

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