Untitled
unknown
plain_text
4 years ago
497 B
5
Indexable
import time import turtle as tt from math import * class polygon: def __init__(self,l=5,n=80): self.l=l self.n=n def phi(self): return (360/self.n) def draw(self): p=tt.turtle() p.write('o') p.up() p.goto(-self.l/2, -self.l/2(2*math.tan(3.14/self.n))) p.down() i=0 while i<self.n: p.forward(self.l) time.sleep(3) p.left(self.phi()) i=i+1 print(p.pos()) n=int(input("donnez le nombre de noeuds")) l=int(input("donnez la largeur l"))
Editor is loading...