home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / ace_basic / ace / include / mathfunc.h < prev    next >
Text File  |  1977-12-31  |  1KB  |  66 lines

  1. { Derived mathematical functions.
  2.  
  3.   Taken from Appendix E of the AmigaBASIC Manual.
  4.  
  5.   Date: 27th December 1993 }
  6.  
  7. '..SECANT
  8. DEF SEC(X)=1/COS(X)
  9.  
  10. '..COSECANT
  11. DEF CSC(X)=1/SIN(X)
  12.  
  13. '..COTANGENT
  14. DEF COT(X)=1/TAN(X)
  15.  
  16. '..INVERSE SINE
  17. DEF ARCSIN(X)=ATN(X/SQR(-X*X+1))
  18.  
  19. '..INVERSE COSINE
  20. DEF ARCCOS(X)=-ATN(X/SQR(-X*X+1))+1.5708
  21.  
  22. '..INVERSE SECANT
  23. DEF ARCSEC(X)=ATN(X/SQR(X*X-1))+SGN(SGN(X)-1)*1.5708
  24.  
  25. '..INVERSE COSECANT
  26. DEF ARCCSC(X)=ATN(X/SQR(X*X-1))+(SGN(X)-1)*1.5708
  27.   
  28. '..INVERSE COTANGENT
  29. DEF ARCCOT(X)=ATN(X)+1.5708
  30.  
  31. '..HYPERBOLIC SINE
  32. DEF SINH(X)=(EXP(X)-EXP(-X))/2
  33.  
  34. '..HYPERBOLIC COSINE
  35. DEF COSH(X)=(EXP(X)+EXP(-X))/2
  36.  
  37. '..HYPERBOLIC TANGENT
  38. DEF TANH(X)=(EXP(-X)/EXP(X)+EXP(-X))*2+1
  39.  
  40. '..HYPERBOLIC SECANT
  41. DEF SECH(X)=2/(EXP(X)+EXP(-X))
  42.  
  43. '..HYPERBOLIC COSECANT
  44. DEF CSCH(X)=2/(EXP(X)-EXP(-X))
  45.  
  46. '..HYPERBOLIC COTANGENT
  47. DEF COTH(X)=EXP(-X)/(EXP(X)-EXP(-X))*2+1
  48.  
  49. '..INVERSE HYPERBOLIC SINE
  50. DEF ARCSINH(X)=LOG(X+SQR(X*X+1))
  51.  
  52. '..INVERSE HYPERBOLIC COSINE
  53. DEF ARCCOSH(X)=LOG(X+SQR(X*X-1))
  54.  
  55. '..INVERSE HYPERBOLIC TANGENT
  56. DEF ARCTANH(X)=LOG((1+X)/(1-X))/2
  57.  
  58. '..INVERSE HYPERBOLIC SECANT
  59. DEF ARCSECH(X)=LOG((SQR(-X*X+1)+1)/X)
  60.  
  61. '..INVERSE HYPERBOLIC COSECANT
  62. DEF ARCCSCH(X)=LOG(SGN(X)*SQR(X*X+1)+1)/X
  63.  
  64. '..INVERSE HYPERBOLIC COTANGENT
  65. DEF ARCCOTH(X)=LOG((X+1)/(X-1))/2
  66.