Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Circle
- self.get_circle(x_center, y_center, r, color, bitmap)
- x = 0
- y = r
- d = r - 1
- while(y >= x)
- bitmap.set_pixel(x, y, color)
- if(d >= 2 * x)
- d = d - 2 * x - 1
- x+=1
- elsif(d <= (2 * r - y))
- d = d + 2 * y - 1
- y-=1
- else
- d + 2 * (y - x - 1)
- y = y -1
- x +=1
- end
- end
- return bitmap
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement