Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Circle {
- public void create(int x0, int y0, int r) {
- int x = r, y = 0, e = 1-x;
- while(x >= y) {
- draw(x0 + x, y0 + y);
- draw(x0 + y, y0 + x);
- draw(x0 - x, y0 + y);
- draw(x0 - y, y0 + x);
- draw(x0 + x, y0 - y);
- draw(x0 + y, y0 - x);
- draw(x0 - x, y0 - y);
- draw(x0 - y, y0 - x);
- ++y;
- if (e < 0)
- e += (y << 2) + 1;
- else
- e += y - --x + 1 << 2;
- }
- }
- public abstract void draw(int x, int y);
- }
Advertisement
Add Comment
Please, Sign In to add comment