Pull the latest commit from https://github.com/stardot/MatrixBrandy to try it out. The implementation of the plot arc code is all in this function: https://github.com/stardot/MatrixBrandy ... graphsdl.c . The implementation starts from lines "3417 case PLOT_ARC" onwards, and in the function "draw_arc", which is new.
Some simple BASIC code to test it is here:
Code: Select all
10REM >TESTARC
20MODE 0
30MOVE 640,512
40SX%=-34:SY%=-200
50OX%=0:OY%=0:OB%=0
60MOUSE ON
70REPEAT
80MOUSE X%,Y%,B%
90IF X%<>OX% OR Y%<>OY% OR B%<>OB% THEN
100CLS
110MOVE 640,512
120DRAW 640+SX%,512+SY%
130IF B%<>0 SX%=X%-640:SY%=Y%-512
140PLOT&A5,X%,Y%
150DRAW 640,512
160OX%=X%:OY%=Y%:OB%=B%
170WAIT
180ENDIF
190WAIT
200UNTIL FALSE
If anyone can take this further then please do, particularly in working out how to implement sectors and segments, and tidying up the existing implementation if possible. Segment seems to be the next easiest of the three to do.
The PLOT arc, sector and segment commands are described on page 134 onwards of this BBC Basic Reference Manual.