home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 521.lha / ICalc_v1.0 / trig.icalc < prev    next >
Text File  |  1991-06-09  |  990b  |  38 lines

  1. # some functions to extend icalc
  2. # MWS, March 24, 1991.
  3.  
  4. silent        # switch off confirmation of definitions
  5.  
  6. func log(z) = ln(z)/LOG10    # base-10 logarithm
  7. func lg(z) = ln(z)/LOG2        # base-2 logarithm
  8.  
  9. #minor trig functions
  10. func csc(z) = 1/sin(z)
  11. func sec(z) = 1/cos(z)
  12. func cot(z) = cos(z)/sin(z)
  13.  
  14. #inverse minor trig functions
  15. func acsc(z) = -i*ln((i+sqrt(sqr(z)-1))/z)
  16. func asec(z) = -i*ln((1+sqrt(1-sqr(z)))/z)
  17. func acot(z) = -0.5*i*ln((z+i)/(z-i))
  18.  
  19. #inverse hyperbolic trig functions
  20. func asinh(z) = ln(z+sqrt(sqr(z)+1))
  21. func acosh(z) = ln(z+sqrt(sqr(z)-1))
  22. func atanh(z) = 0.5*ln((1+z)/(1-z))
  23.  
  24. #minor hyperbolic trig functions
  25. func csch(z) = 1/sinh(z)
  26. func sech(z) = 1/cosh(z)
  27. func coth(z) = cosh(z)/sinh(z)
  28.  
  29. #inverse minor hyperbolic trig functions
  30. func acsch(z) = ln((1+sqrt(1+sqr(z)))/z)
  31. func asech(z) = ln((1+sqrt(1-sqr(z)))/z)
  32. func acoth(z) = 0.5*ln((z+1)/(z-1))
  33.  
  34. #Stirling's formula
  35. func stirl(n) = sqrt(2*n*PI)*(n/E)^n*(1+1/(12*n))
  36.  
  37. verbose        # restore display of results, messages
  38.