vbdpss.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Article Q28249
                                                 Contents  Index  Back
─────────────────────────────────────────────────────────────────────────────
                           Knowledge Base Contents  Knowledge Base Index
 
 How to Derive Inverse (ARC) and Hyperbolic Trig Functions - Q28249
 
 From the built-in BASIC functions LOG, COS, SIN, TAN, SGN, EXP, and
 SQR, you can derive the other transcendental functions as shown below.
 
 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.