Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Trigonmetric Functions Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
' The example shows how ATN, COS, SIN, and TAN can be used to derive other
' trigonometric functions.
' To try this example:
' 1. Choose New Project from the File menu
' 2. Copy the code example below to the code window
' 3. Press F5 to run the example
CLS ' Clear the screen
PI# = 3.14159265359# ' Value for Pi
PRINT "PI:", PI#
X# = PI# / 4# ' 45 degrees/pass angle in radians
Sec# = 1 / COS(X#) ' Calculates Secant
PRINT "Secant:", Sec#
Csc# = 1 / SIN(X#) ' Calculates CoSecant
PRINT "CoSecant:", Csc#
Cot# = 1 / TAN(X#) ' Calculates CoTangent
PRINT "CoTangent:", Cot#
Arcsin# = ATN(X# / SQR(1 - X# * X#)) ' Calculates ArcSin
PRINT "ArcSin:", Arcsin#
' To convert from Degrees to Radians multiply Degrees by PI#/180.
' To convert from Radians to Degrees multiply Radians by 180/PI#.