from math import * from kandinsky import * from turtle import * def cercle(x0,y0,r,c,e): for i in range(2*e): xd=x0-int((r-i*0.5)/sqrt(2)) xf=x0+int((r-i*0.5)/sqrt(2)) for x in range(xd,xf+1): x1=x y1=y0+int(sqrt((r-i*0.5)**2-(x-x0)**2)) set_pixel(x,y1,c) for j in range(3): x2=x0+y1-y0 y2=y0+x0-x1 set_pixel(x2,y2,c) x1,y1=x2,y2 def cercle_plein(x0,y0,r,c1,e,c2): cercle(x0,y0,r,c1,e) cercle(x0,y0,r-e,c2,r-e) def cercle_grade(x0,y0,R,c1,e,c2): for i in range(R): r=c1[0]+i*(c2[0]-c1[0])//R g=c1[1]+i*(c2[1]-c1[1])//R b=c1[2]+i*(c2[2]-c1[2])//R cercle(x0,y0,i,color(r,g,b),1) c_noir=[0,0,0] c_bleu=[0,0,0] cercle_grade(160,111,197,c_bleu,10,c_noir) cercle_grade(160,111,40,c_soleil2,2,c_bleu) cercle_grade(160,111,16,c_soleil,2,c_soleil2) pencolor(252,252,252) v=0 while v < 150: forward(2*5) left(144) forward(2*5) left(144) forward(2*5) left(144) forward(2*5) left(144) forward(2*5) left(144) v = v + 1 penup() avancer=randint(5,60) angle=randint(5,40) forward(avancer) left(angle) pendown()