C=============================================================================== C RPL/2 (R) version 4.0.17 C Copyright (C) 1989-2010 Dr. BERTRAND Joël C C This file is part of RPL/2. C C RPL/2 is free software; you can redistribute it and/or modify it C under the terms of the CeCILL V2 License as published by the french C CEA, CNRS and INRIA. C C RPL/2 is distributed in the hope that it will be useful, but WITHOUT C ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or C FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL V2 License C for more details. C C You should have received a copy of the CeCILL License C along with RPL/2. If not, write to info@cecill.info. C=============================================================================== C=============================================================================== C Fonctions trigonometriques diverses C=============================================================================== C------------------------------------------------------------------------------- C Sinus (argument en radians) C------------------------------------------------------------------------------- subroutine F77SIN(ARGUMENT, RESULTAT) implicit none complex*16 ARGUMENT complex*16 RESULTAT RESULTAT = sin(ARGUMENT) return end C------------------------------------------------------------------------------- C Arcsin (argument en radians) C------------------------------------------------------------------------------- subroutine F77ASIN(ARGUMENT, RESULTAT) implicit none complex*16 ARGUMENT complex*16 RESULTAT RESULTAT = (0,-1) * log(((0,1) * ARGUMENT) + sqrt(1 - + (ARGUMENT ** 2))) return end C------------------------------------------------------------------------------- C Cosinus (argument en radians) C------------------------------------------------------------------------------- subroutine F77COS(ARGUMENT, RESULTAT) implicit none complex*16 ARGUMENT complex*16 RESULTAT RESULTAT = cos(ARGUMENT) return end C------------------------------------------------------------------------------- C Arccos (argument en radians) C------------------------------------------------------------------------------- subroutine F77ACOS(ARGUMENT, RESULTAT) implicit none complex*16 ARGUMENT complex*16 RESULTAT RESULTAT = (0,-1) * log(ARGUMENT + sqrt((ARGUMENT ** 2) - 1)) return end C------------------------------------------------------------------------------- C Tangente (argument en radians) C------------------------------------------------------------------------------- subroutine F77TAN(ARGUMENT, RESULTAT, ERREUR) implicit none complex*16 ARGUMENT complex*16 COSINUS complex*16 RESULTAT integer*4 ERREUR ERREUR = 0 if (dimag(ARGUMENT).eq.0) then RESULTAT = dtan(dble(ARGUMENT)) else COSINUS = cos(ARGUMENT) if (COSINUS.ne.0) then RESULTAT = sin(ARGUMENT) / COSINUS else RESULTAT = 0 ERREUR = -1 end if end if return end C------------------------------------------------------------------------------- C Arctg (argument en radians) C------------------------------------------------------------------------------- subroutine F77ATAN(ARGUMENT, RESULTAT, ERREUR) implicit none complex*16 ARGUMENT complex*16 RESULTAT integer*4 ERREUR ERREUR = 0 if ((ARGUMENT.ne.(0,1)).and.(ARGUMENT.ne.(0,-1))) then RESULTAT = (0,.5) * log(((0,1) + ARGUMENT) / + ((0,1) - ARGUMENT)) else RESULTAT = 0 ERREUR = -1 end if return end