home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST146.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  794 b   |  31 lines

  1. ********************
  2.  
  3. FUNCTION Sin
  4.  
  5.    * Written and contributed by ESSOR MASO
  6.    *
  7.    * For the input argument in the first circle, degrees -360 <=arg <=360.
  8.    *
  9.    * The error ABS(e(arg)) <= 2*10^(-9)
  10.    * The value 2 is returned if either the argument or the D or R is missing,
  11.    * or the ABS(arg) > 360.
  12.    *
  13.    * Correct form: SIN(arg,'D')
  14.    *
  15.    * National Bureau of Standards Handbook of Mathematical Functions
  16.  
  17.    PARAMETERS _sinwork, _sindeg
  18.  
  19.    IF TYPE("_sinwork") + TYPE("_sindeg") != "NC"
  20.       RETURN(2)
  21.    ENDIF
  22.  
  23.    SET DECIMAL TO 10
  24.  
  25.    IF ABS(IF(UPPER(_sindeg)#'D', _sinwork, _sinwork*1.5707963268/90))>6.2831853072 .OR. PCOUNT()#2
  26.       RETURN(2)
  27.    ENDIF
  28.    RETURN(COSIN(IF(_sindeg # 'D',1.5707963268,90) - _sinwork, _sindeg))
  29.  
  30. * End of File
  31.