' This program port to BAM by Charlie Veniot
' Based on a program shared by Andy Johnson (https://www.facebook.com/groups/2057165187928233/permalink/3513502548961149/?mibextid=oMANbw)
' Other than the noted additions to handle mouse/touch, the program was left as-is.
' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2023.10.26.02.14]) on 2023.11.13 at 22:19 (Coordinated Universal Time)

10 CLS
20 DIM PI!,SR%,RA!,SC%,ST!
30 ST!=.08
35 REM Row, Column, Radius, Pi
40 SR%=12:SC%=1:RA!=10:PI=3.14159
50 LOCATE SR%,SC%:PRINT STRING$(79,"-")
55 REM Loop from -PI to PI, compute the Coordinate using RADIUS*SIN
56 REM then add it to the row number ... negative will subract
57 REM positive will add
60 FOR A=-1*PI TO PI STEP ST!
70 SR%=12+(RA!*SIN(A))
75 REM Increase the row and column and check for bounds
80 IF SR%>0 AND SR%<23 THEN LOCATE SR%,SC%: PRINT "+"
90 SC%=SC%+1
100 IF SC%>79 THEN GOTO 130
110 NEXT A
120 IF SC%<79 THEN GOTO 60
130 LOCATE 23,1:PRINT"(Q)uit, Phase (U)p/(D)own"
140 LOCATE 22,1:PRINT ST!;" ";ST!*180/PI;" DEGREES"
150 B$=INKEY$
160 IF B$="U" THEN ST!=ST!+.01:CLS:GOTO 40
170 IF B$="D" THEN ST!=ST!-.01:CLS:GOTO 40
180 IF B$="Q" THEN GOTO 200
181 REM 🟠 Charlie added lines 182 to 186
182 IF _MOUSEBUTTON THEN WHILE _MOUSEBUTTON : WEND : GOTO 184
183 GOTO 190
184 IF _MOUSEZONE(0,22*8,48,8) THEN GOTO 200
185 IF _MOUSEZONE(112,22*8,32,8) THEN ST!=ST!+.01 : CLS : GOTO 40
186 IF _MOUSEZONE(152,22*8,48,8) THEN ST!=ST!-.01 : CLS : GOTO 40
190 GOTO 150
200 CLS:END