def cercle(pix,cx,cy,r,color): hAvant=round((r**2-(r)**2)**(1/2)+cy) l=[] for x in range(cx-r,cx+r+1): hMaintenant=round((r**2-(x-cx)**2)**(1/2)+cy) for y in range(min(hAvant,hMaintenant),max(hAvant,hMaintenant)+1): l.append([x,y]) hAvant=hMaintenant l=l+reflexion(l,cy) for elem in l: pix[elem[0],511-round(elem[1])]=color
def disque(pix,cx,cy,r,color): hAvant=round((r**2-(r)**2)**(1/2)+cy) l=[] for x in range(cx-r,cx+r+1): hMaintenant=round((r**2-(x-cx)**2)**(1/2)+cy) for y in range(min(hAvant,hMaintenant),max(hAvant,hMaintenant)+1): l.append([x,y]) hAvant=hMaintenant l=l+reflexion(l,cy) for elem in l: x=elem[0] y=511-round(elem[1]) pix[x,y]=color if x<cx: debut=x fin=x+(cx-x)*2 for i in range(debut,fin+1):pix[i,y]=color