Re: A86: Drawing circles


[Prev][Next][Index][Thread]

Re: A86: Drawing circles



Butler Family wrote:
> 
> center of circle is cx,cy
> and radius is r
> 
> Cls
> Screen 12
> x=0
> y=r
> d=3-(2*r)
> While x<=y
> PtOn(xc+x,yc+y)
> PtOn(xc+x,yc-y)
> PtOn(xc-x,yc+y)
> PtOn(xc-x,yc-y)
> PtOn(yc+y,xc+x)
> PtOn(yc+y,xc-x)
> PtOn(yc-y,xc+x)
> PtOn(yc-y,xc-x)
> If d<0 Then
> d=d+4*x+6
> Else
> d=d+4*(x-y)+10
> End If
> x=x+1
> Wend
> 
> this is a quick basic version i havent tried it out on quick basic yet but it
> should work
> 
> Patrick

another way of doing this faster, but with a minor flaw (some of the
circles are minorly distorted) is to use a line and draw ahead about 4
places around the circle, saves a lot of time


References: