Get all points in circle

BlitzMax Forums/BlitzMax Programming/Get all points in circle

I've been using this one, it's pretty simple. Just replace the dawrect, with: create object at dotx,doty.

'Goes through each pixel in a circle, so you can access them.
Function CirclePixels(x:Int, y:Int, r:Int)
	Local rx:Float
	Local dotx:Int, doty:Int
	Local rr:Int
	
	rr = r * r
	
	For doty = y - r To y + r
		rx = Sqr(rr - (doty - y) * (doty - y))
		For dotx = x - rx To x + rx
			DrawRect dotx, doty, 1, 1
		Next
	Next
EndFunction