How to Derive Inverse (ARC) and Hyperbolic Trig Functions

ID: Q28249


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
  • Microsoft QuickBASIC for MS-DOS, versions 1.00, 1.01, 1.02, 2.00, 2.01, 3.00, 4.0, 4.0b, 4.5
  • Microsoft BASIC Compiler for MS-DOS and MS OS/2, versions 6.0, 6.0b
  • Microsoft BASIC Compiler for MS-DOS, versions 5.35, 5.36
  • Microsoft GW-BASIC, versions 3.2, 3.22, 3.23
  • Microsoft BASIC Interpreter for Apple Macintosh, versions 1.0, 1.01, 2.0, 2.1, 3.0
  • Microsoft BASIC Compiler, version 1.0
    on the following platforms: MACINTOSH
  • Microsoft QuickBASIC for the Macintosh, version 1.0
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2, versions 7.0, 7.1
  • Microsoft Business Basic Compiler for MS-DOS, versions 1.0 and 1.1 (discontinued product)
  • Microsoft Basic Interpreter (BASIC86.EXE) for MS-DOS, version 5.28


SUMMARY

From the built-in BASIC functions LOG, COS, SIN, TAN, SGN, EXP, and SQR, you can derive the other transcendental functions as shown below.

This information is also included with the Help file provided with the Standard and Professional Editions of Microsoft Visual Basic for MS-DOS, version 1.0.


MORE INFORMATION

The following trigonometric and mathematical functions that are not intrinsic to Microsoft Visual Basic for MS-DOS can be calculated as shown. In these formulas, X is an angle measured in radians and Y is a unitless number:



Function                  BASIC Equivalent
--------                  ----------------

Secant                    SEC(X) = 1/COS(X)
Cosecant                  CSC(X) = 1/SIN(X)
Cotangent                 COT(X) = 1/TAN(X)
Inverse Sine              ARCSIN(Y) = ATN(Y/SQR(1-Y*Y))
Inverse Cosine            ARCCOS(Y) = -ATN(Y/SQR(1-Y*Y)) + Pi/2
Inverse Secant            ARCSEC(Y) = ATN(Y/SQR(1-Y*Y)) + (SGN(Y)-1)
                                      * Pi/2
Inverse Cosecant          ARCCSC(Y) = ATN(1/SQR(1-Y*Y)) + (SGN(Y)-1)
                                      * Pi/2
Inverse Cotangent         ARCCOT(Y) = -ATN(Y) + Pi/2
Hyperbolic Sine           SINH(Y) = (EXP(Y) - EXP(-Y))/2
Hyperbolic Cosine         COSH(Y) = (EXP(Y) + EXP(-Y))/2
Hyperbolic Tangent        TANH(Y) = (EXP(Y) - EXP(-Y))/(EXP(Y)
                                    + EXP(-Y))
Hyperbolic Secant         SECH(Y) = 2/(EXP(Y) + EXP(-Y))
Hyperbolic Cosecant       CSCH(Y) = 2/(EXP(Y) - EXP(-Y))
Hyperbolic Cotangent      COTH(Y) = EXP(-Y)/(EXP(Y) - EXP(-Y)) * 2 + 1
Inverse Hyperbolic Sine   ARCSINH(Y) = LOG(Y + SQR(Y*Y+1))
Inverse Hyperbolic Cos    ARCCOSH(Y) = LOG(Y + SQR(Y*Y-1))
Inverse Hyperbolic Tan    ARCCTANH(Y) = LOG((1 + Y)/(1 - Y)) / 2
Inverse Hyperbolic CSC    ARCCSCH(Y) = LOG((SGN(Y)*SQR(Y*Y+1)+1)/Y)
Inverse Hyperbolic Sec    ARCSECH(Y) = LOG((SQR(1-Y*Y)+1) / Y)
Inverse Hyperbolic Cot    ARCCOTH(Y) = LOG((Y+1)/(Y-1)) / 2 
The general formulas listed above may be used in Microsoft Visual Basic for MS-DOS or any other language. Note that the constant Pi has the following approximate value:

   Pi# = 3.14159265359
   Pi# = 4.0# * ATN(1.0#) 
To convert degrees to radians, multiply the degrees by pi/180.

Additional query words: VBmsdos QuickBas BasicCom MQuickB

Keywords :
Version : MS-DOS:1.0,1.00,1.01,1.02,2.00,2.01,3.00,4.0,4.0b,4.5; :1.0,1.01,2.0,2.1,3.0,3.2,3.22,3.23,5.35,5.36,6.0,6.0b,7.0,7.1
Platform : MS-DOS
Issue type :


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.