All pastes #908252 Raw Edit

k4st

public text v1 · immutable
·published 2008-02-18 07:11 UTC
rendered paste body
Given a circle of radius R centred at (X, Y)
public void circleNegate(int centerx, int centery, int radius)
{
  for(int y=centery-radius, y<=radius, y++)
// right so far?
for x in [X-R, X+R]:
    for y in [Y-R, Y+R]:
        
        if distance([x,y], [X,Y]) <= R:
            negate pixel
            
    end
end