SHARE
TWEET

Untitled

a guest Oct 21st, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import turtle
  2. from math import sin , cos , pi
  3. longueur=20
  4.  
  5.  
  6. def hexagone(point, longueur, col, centre, rayon):
  7.  
  8.     turtle.begin_fill()
  9.     turtle.color(col[0])
  10.     for i in range (3):
  11.        turtle.goto(longueur*cos(i*pi/3), longueur*sin(i*pi/3))
  12.     turtle.end_fill()
  13.     turtle.goto(point[0], point[1])
  14.  
  15.  
  16.     turtle.begin_fill()
  17.     turtle.color(col[1])
  18.     for i in range (2, 5) :
  19.        turtle.goto(longueur*cos(i*pi/3), longueur*sin(i*pi/3))
  20.     turtle.end_fill()
  21.     turtle.goto(point[0], point[1])
  22.  
  23.  
  24.     turtle.begin_fill()
  25.     turtle.color(col[2])
  26.     for i in range (4,7) :
  27.       turtle.goto(longueur*cos(i*pi/3), longueur*sin(i*pi/3))
  28.     turtle.goto(point[0], point[1])
  29.     turtle.end_fill()
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. hexagone((0, 0), longueur, ["blue", "black", "red"], 0, 0)
  37. turtle.mainloop()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top