-
-
Save Ansarina/3c800c4d2e0ae53ea6af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM func | |
EXTERNAL CTN | |
INTRINSIC SIN, COS | |
REAL::angle=0.785 !...pi/4 | |
REAL::sine,cosine,tangent | |
CALL TRIG(angle,SIN,sine) | |
WRITE(*,*) 'SIN(0.785)=',sine | |
CALL TRIG(angle,COS,cosine) | |
WRITE(*,*) 'COS(0.785)=',cosine | |
CALL TRIG(angle,CTN,cotangent) | |
WRITE(*,*) 'COTAN(0.785)=',cotangent | |
PAUSE | |
END PROGRAM func | |
SUBROUTINE TRIG(X,F,Y) | |
Y = F(X) | |
RETURN | |
END SUBROUTINE TRIG | |
FUNCTION CTN(X) | |
CTN = COS(X)/SIN(X) | |
RETURN | |
END FUNCTION CTN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment