RUVIDEO
Поделитесь видео 🙏

Simple Python Turtle Graphic and Code: Starry Lantern

Little stars around a bigger one to create a festive lantern. The little stars sit equally spaced from each other using a fixed arc length that little by little create the big circle.

Feel free to copy the basic Python Turtle code that is given below. Don't hesitate to ask questions about the code if you have any. Enjoy! Please comment, like, or subscribe :)

Incidentally, for more graphics and variations, please visit my author url at https://www.amazon.com/author/basicpythonturtleart.url


import turtle
t = turtle.Turtle() #Definitions and Initializations
screen = turtle.Screen()
t.pensize(4)
star_size = 140 #The distance from center to one tip of the big star: Changeable
def big_star(): #Procedure for drawing the big star in the middle
t.pencolor("yellow")
t.fillcolor("yellow") #Pen and fill colors set to same yellow to ensure unicolor graphic
t.begin_fill()
for i in range(5): #For 5 structural lines that create the big star
if i == 0: #For first tip of big star where i = 0
t.right(180 - 18) #Turtle direction to draw the first structural line of of big star
t.forward(2 * 0.9511 * star_size) #0.9511 = sin 72, taken from the 18-72-90 triangle of star "head"
continue #To proceed to "for" loop
else: #Drawing instruction if i is no longer 0; Drawing procedure for
t.right(180 - 36) #the 2nd up to the 5th structural lines of big star
t.forward(2 * 0.9511 * star_size)
t.end_fill() #Execution of fill color upon completing the 5 structural lines
def little_star(): #Procedure for drawing a little star
t.pencolor("red")
t.fillcolor("red") #Pen and fill colors set to same red to ensure unicolor graphic
t.begin_fill()
for i in range(5): #Procedure to draw 5 structural lines of little star
t.forward((4 / 5) * star_size) #Length of structural line for little star defined in terms of
t.left(180 - 36) #big star's star_size; 180 - 36 direction for next line
t.end_fill() #Execution of fill color upon completion of the 5 structural lines
t.penup() #Python_graphic start of drawing procedure
t.left(90) #Turtle direction to first tip of big star
t.forward(star_size) #Trail-less movement of turtle to reach the northern tip of big star
t.pendown() #Start of drawing the big star
big_star() #Function call to draw the big star
for i in range (10): #For 10 little stars surrounding the big one
little_star() #Function call to draw a little star
t.left(72 + 36) #Turtle direction to draw an arc
t.pencolor("blue") #Pen color for the arc
t.circle(star_size, 360 / 10) #Drawing of the arc; the 10 for the number of little stars
t.right(72 + 36) #Turtle direction to draw a little star
t.hideturtle()
screen.exitonclick()

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Simple Python Turtle Graphic and Code: Starry Lantern», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.