I've been trying to make a circle function that draws a circle but it leaves out some pixels. can anyone tell me why?
Graphics 800,600
SetBuffer BackBuffer()
LockBuffer BackBuffer()
circle1(300,255 Shl 16)
UnlockBuffer BackBuffer()
Flip
WaitKey()
Function circle1(radius,col)
d=(Sqr((radius^2)*2))/2
For x=-d To d
For y=-d To d
WritePixelFast(x+400,y+300,col)
Next
Next
For dist=d To radius
Steps#=180/(dist*Pi*2);Lower number = highr quality
a#=0
Repeat
a#=a#+steps#
WritePixelFast(Sin(a#)*dist+400,Cos(a#)*dist+300,col)
;x=Sin(a#)*dist+400
;y=Cos(a#)*dist+300
Until a#=>360
Next
End Function
Function circle2(radius,col)
For dist=0 To radius
Steps#=180/(dist*Pi*2);change 180 for diffren speed and quality... in my theory it should be perfect at 360 buy it isnt
a#=0
Repeat
a#=a#+steps#
WritePixelFast(Sin(a#)*dist+400,Cos(a#)*dist+300,col)
;x=Sin(a#)*dist+400
;y=Cos(a#)*dist+300
Until a#=>360
Next
End Function