Compucolor.org – Virtual Media

Listing of file='ARCTN.BAS;02' on disk='vmedia/ncc_23-sector.ccvf'

100 REM *** MAIN PROGRAM FOR ARCTAN ***
101 PLOT 12,6,2
102 INPUT "INPUT VALUE FOR X  ";X:PRINT
103 INPUT "INPUT VALUE FOR Y  ";Y:PRINT ""
104 GOSUB 6000:REM  ARCTAN SUBROUTINE
105 PRINT "       ";AD;" DEGREES";,"       ";AR;" RADIANS"
107 PRINT :INPUT "HIT 'C'ONTINUE OR 'M'ENU  AND THEN 'ENTER'  ";Z$
108 IF Z$= "C" THEN 101
109 IF  Z$= "M" THEN 120
110 PRINT  "INVALID INPUT":GOTO 107
120 PLOT  12:PRINT  "END OF PROGRAM.  SEE YA LATER.  LOADING MENU":FOR  I= 0TO 250:NEXT  I:PLOT 1
6000 REM  *** 4 QUADRANT ARCTAN SUBROUTINE ***
6010 REM  FROMS HOWARD M. BERLINE LTD.
6020 REM  TRS 80 LEVELTWO VERSION CONVERTED TO CCII BY LRM ***
6030 REM  INPUTS X & Y OUTPUTS AR = ARCTAN IN RADIANS; ***
6040 REM  AD = ARCTAN IN DEGREES ***
6050 IF Y= 0THEN 6060
6055 GOTO  6090
6060 IF X< 0THEN 6070
6065 GOTO  6080
6070 AR= - 3.1415927:GOTO 6190
6080 AR= 0:GOTO 6190
6090 IF X> 0THEN 6100
6095 GOTO  6120
6100 IF Y< > 0THEN 6110
6105 GOTO  6160
6110 AR= ATN (Y/ X):GOTO 6190
6120 IF X= 0THEN 6130
6125 GOTO  6160
6130 IF  Y< 0 THEN 6140
6135 GOTO  6150
6140 AR= - 1.5707963:GOTO 6190
6150 AR= 1.5707963:GOTO 6190
6160 IF X< 0THEN 6170
6165 GOTO  6190
6170 IF Y< > 0THEN 6180
6175 GOTO  6050
6180 AR= 3.1415927+ ATN (Y/ X)
6190 AD= AR* 57.2957795:RETURN