Hi David, I'd be curious about your comparison to the speed of circle drawing with your BASIC routine compared to the CIRVLE(X,Y),R routine in the latest Sardos for the T200. :)
Also wondering how your algorithm compares to the one I'm using iny routine, as it relates to how well it interprets curvature at the lower radius circles. If you want to play with a SARDOS option from for the 200 you can download it from the SARDOS download area. https://www.web8201.net/default.asp?content=/Files/body.asp%3Fname=SARDOS/TS-DOS%20(NEC/M100/T200)%26url=SARDOS_TSDOS Gary On Thu, Oct 22, 2026, 8:02 AM David Szasz <[email protected]> wrote: > Hi Again: > > Here is a subroutine to draw the largest polygon or "circle" on a m200 > screen: (This relates to the m100 discussion list on 10/16/26 regarding > a CIRCLE() command for the Model-T computers.) > > 10 'DRAW REG POLYGON OR "CIRCLE" > 20 CLS > 35 XC=120:YC=63 'SET SCREEN CTR > 40 R=63 'SET RADIUS IN PIXELS > 50 N=24 'SET NO. OF SIDES > 60 PI=4*ATN(1) 'SET SINGLE PRECISION PI > 70 DA=(2*PI)/N 'ANGLE STEP PER VERTEX > 90 X1=XC+R*COS(0):Y1=YC+R*SIN(0) 'CALC 1ST VERTEX > 110 X0=X1 'SAVE START POINT > 120 FOR I=1TON 'STEP > 130 A=I*DA > 140 X2=XC+R*COS(A):Y2=YC+R*SIN(A) > 160 LINE (X1,Y1)-(X2,Y2) > 170 X1=X2:Y1=Y2 > 180 NEXTI > 190 END > > I am a "novice" m100-BASIC programmer so you will forgive any violation of > your sensibilities. The code works well when drawing a figure with a low > number of corners or "vertices", like a triangle or petagon. But you will > see if you draw a polygon with a low radius value (like 10) with a high > number of sides (like 24) it starts to look like a piece of "popcorn". I > wrote it originally in GWBasic and there it takes on an elongated > appearance due to the aspect ratio of GWbasic for an early PC screen. Hence > the ability of the CIRCLE() command in GWBasic to change the aspect ratio > to make the circle look better. On the m200 I'm guessing that the pixels > are more square so it looks OK as is. > > 1.) In the real world (whatever that is?) I would add code to save the > coordinates of the vertices to an array. Then take the coordinates and draw > a polygon from that. It would take less code and save processing time. But > for just "playing" around this is OK. > > 2.) In books relating to the Model-T computers they always plot the > individual points of a circle, which looks better but takes an eternity to > draw. > > 3.) For the m100 screen size one will have to reduce the values of YC in > line 35 and R in line 40 accordingly. > > 4.) As expected, values exceeding screen size will cause an error. > > > >
