home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compy Shop Magazin 1989 May
/
Compy_Shop_Magazin_1989_05___de_Side_B.atr
/
hyperbel.i
< prev
next >
Wrap
Text File
|
2023-02-26
|
927b
|
1 lines
(* Die Hyperbel-Funktionen *)¢¢ (* sinh,cosh,tanh,coth,sech,cosech *)¢¢ (* arcsinh,arcosh,artanh,arcoth *)¢¢FUNCTION sinh(X:REAL):REAL;¢¢BEGIN¢ sinh:=(EXP(X)-EXP(-X))/2¢END;¢¢FUNCTION cosh(X:REAL):REAL;¢¢BEGIN¢ cosh:=(EXP(X)+EXP(-X))/2¢END;¢¢FUNCTION sech(X:REAL):REAL;¢¢BEGIN¢ sech:=1/cosh(X)¢END;¢¢FUNCTION cosech(X:REAL):REAL;¢¢BEGIN¢ cosech:=1/sinh(X)¢END;¢¢FUNCTION tanh(X:REAL):REAL;¢¢VAR X1,X2:REAL;¢¢BEGIN¢ X1:=EXP(X); X2:=EXP(-X);¢ tanh:=(X1-X2)/(X1+X2)¢END;¢¢FUNCTION coth(X:REAL):REAL;¢¢VAR X1,X2:REAL;¢¢BEGIN¢ X1:=EXP(X); X2:=EXP(-X);¢ coth:=(X1+X2)/(X1-X2)¢END;¢¢FUNCTION arcsinh(X:REAL):REAL;¢¢BEGIN¢ arcsinh:=ln(X+SQRT(X*X+1))¢END;¢¢FUNCTION arcosh(X:REAL):REAL;¢¢BEGIN¢ IF X>=0 THEN¢ arcosh:=ln(X+SQRT(X*X-1))¢ ELSE¢ arcosh:=ln(X-SQRT(X*X-1))¢END;¢¢FUNCTION artanh(X:REAL):REAL;¢¢BEGIN¢ artanh:=ln((1+X)/(1-X))/2¢END;¢¢FUNCTION arcoth(X:REAL):REAL;¢¢BEGIN¢ arcoth:=ln((X+1)/(X-1))/2¢END;¢¢