To implement rounding, change to:
int(x + xoffset + .5)^2 + int(y + yoffset + .5)^2 <= radius^2
what do I have to change to this?
anyway if you change
if x^2+y^2 <= radius^2 then dot x,y to if
x^2+y^2 < radius^2 then dot x,y it's also better
I also added an antialiasing effect... I have put it in a function but it doesnt respond on the ink command used before the function... In order to change this I should be able to find out what's the current foreground and background color values are...
Is there some command to return those?
here's the code:
sync on
sync rate 30
ink rgb(150,25,0),0
circle(100,100,16)
sync
end
function circle(xoffset,yoffset,radius)
rem average color
ink rgb(75,12,0),0
radius=radius+1
xoffset=100
yoffset=100
for x=-1*radius to radius
for y=-1*radius to radius
if x^2+y^2 < radius^2
dot x+xoffset,y+yoffset
endif
next x
next y
rem normal color
ink rgb(150,25,0),0
dec radius
for x=-1*radius to radius
for y=-1*radius to radius
if x^2+y^2 < radius^2
dot x+xoffset,y+yoffset
endif
next x
next y
endfunction
[href]www.bernardfrancois.com[/href]