Python Turtle Tutorials 10 # Spiral Rosettes

Veröffentlicht am: 01 Januar 1970
auf dem Kanal: Coder & Maker
128
0

Lets draw a Spiral Rosettes in Python Turtle Library.

Download Thonny Ide: https://thonny.org

#CODE

import turtle
turtle.penup()
turtle.speed(0)
turtle.bgcolor('black')
#ask the user for the number of sides, default to 4, min 2 , max 6
sides = int (turtle.numinput ('Number of sides','How many sides in your spiral of rossettes?', 4, 2, 6 ) )
colors=['red','yellow','blue','green','purple','orange']
#our outer spiral loop
for m in range(100):
turtle.forward(m*4)
position = turtle.position() #remember this corner of the spiral
heading = turtle.heading() # remember the direction we were heading
#our inner spiral loop draws a rosette
for n in range(sides):
turtle.pendown()
turtle.pencolor(colors[n%sides])
turtle.circle(m/5)
turtle.right(360/sides-2)
turtle.width(m/20)
turtle.penup()
turtle.setx(position[0]) #go back to the big spiral's x location
turtle.sety(position[1]) #go back to the big spiral's y location
turtle.setheading(heading) #point in the big spiral's direction/heading
turtle.left(360/sides+2) #move to the next point on the big spiral, lets try



More Python Turtle Graphics Tutorials:    • Python Turtle Tutorials 1 # Draw Square Sp...  
Good Luck...

Music of this video;

Gymnopedie No 2 de Kevin MacLeod cuenta con una licencia Creative Commons Atribución 4.0. https://creativecommons.org/licenses/...

Fuente: http://incompetech.com/music/royalty-...

Artista: http://incompetech.com/


Auf dieser Seite können Sie das Online-Video Python Turtle Tutorials 10 # Spiral Rosettes mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Coder & Maker 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 128 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!