All pastes #908253 Raw Edit

k4st

public text v1 · immutable
·published 2008-02-18 07:13 UTC
rendered paste body
Given a circle of radius R centred at (X, Y)
public void circleNegate(int centerx, int centery, int radius)
{
  int x, y;
  for(y=centery-radius; y<=centery+radius; y++) {
     for(x = centerx-radius; x <= centerx+radius; x++) {
        if(distance({x, y}, {centerx, centery}) <= radius)
           negate(x, y);
     }
  }
}