? Even More Perfectly Filled Circles ● SmileBASIC Source

Sign In

*Usernames are case-sensitive
Forgot my password

Even More Perfectly Filled Circles

DEF GDISK X,Y,RADIUS,COL IF RADIUS<1 THEN GPSET X,Y,COL:RETURN '(GCIRCLE draws nothing if the radius is 0) 'get the point on the graphics layer that is closest to the center of the circle VAR PX=MIN(MAX(X,0),512-1) VAR PY=MIN(MAX(Y,0),512-1) 'if the distance from the center of the circle to the closest onscreen point is 'larger than the radius, then the circle is completely offscreen VAR DX=PX-X VAR DY=PY-Y IF DX*DX+DY*DY > RADIUS*RADIUS THEN RETURN 'traditional filled circle code GCIRCLE X,Y,RADIUS,8 GPAINT PX,PY,COL,8 GCIRCLE X,Y,RADIUS,COL END
5 votes
  • filled
  • circle
  • disk
1 Comment(s) Heredos Heredos Avatar Taboo I didn't change my avatar for 180 days Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Need this for my game. Thanks