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

Simple Python Turtle Graphic and Code: Esoteric Sun

An image of sun made mystical by the paisleys around the center. The simple and structured Python Turtle code below defines the procedure for drawing the paisleys.

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 manually colorable graphics and variations, please visit my author site at https://www.amazon.com/author/basicpythonturtleart.url

import turtle
t = turtle.Turtle() #Definitions and Initializations
screen = turtle.Screen()
t.pensize(4)
radius = initial_radius = 240 #Changeable radius of graphic; fixed initial_radius
number_of_flares = 12 #Count of flare tips on sun's circumference
new_flare = () #Holder of ordered pair for a discovered point
list_of_flares = [] #Holder of ordered pairs corresponding to 2 flare tips on circumference
radius_change = 40 #Difference between radii of two overlapping suns
paisley_size = 150 #Length of paisley from top to bottom
number_of_paisleys = 6 #Count of paisleys around the center of graphic
def distance_between_flares(): #Procedure to start calculating line length from 1 flare tip to the next
t.left(90)
t.forward(radius)
t.left(90)
for i in range(2): #Loop to identify two ordered pairs corresponding to 2 flare tips
new_flare = t.position()
list_of_flares.append(new_flare)
t.circle(radius, 360 / number_of_flares)
t.goto(list_of_flares[0]) #Preparation to measure line from first flare tip to the next
def sun(x): #Procedure for drawing a color-filled sun with radius x
t.penup()
t.home()
t.left(90)
t.forward(x)
t.left(150 + 180 / number_of_flares)
t.pendown()
for i in range(number_of_flares):
t.circle(- (1 / (3 ** (1 / 2)) * (radius / initial_radius) * distance_bet_flares), 120) #A 120-degree arc between
t.left(360 / number_of_flares + 120) #two consecutive flare tips
def paisley(): #Procedure for drawing a paisley
t.circle(paisley_size / 4, 180)
t.circle(-(3 / 16) * paisley_size, 180)
t.right(90)
t.circle((1 / 8) * paisley_size, 270)
t.forward((1 / 8) * paisley_size)
t.circle((1 / 2) * paisley_size,180)
t.penup() #Python_Graphic start of drawing procedure
distance_between_flares() #Function call to start calculating distance between 2 flare tips
distance_bet_flares = t.distance(list_of_flares[1]) #Formula for calculating distance between 2 flare tips
for color in ["yellow", "gold", "yellow"]: #Loop to draw 3 overlapping suns with indicaated colors
t.fillcolor(color)
t.begin_fill()
sun(radius)
t.end_fill()
radius -= radius_change #Shortening of radius for the next color-filled sun
for i in range(number_of_paisleys): #Loop to draw the indicated number of color-filled paisleys
t.penup() #around the center of graphic
t.home()
t.left(((1 + i) * 360 / number_of_paisleys))
t.forward(50)
t.right(90)
t.pendown()
t.fillcolor("turquoise")
t.begin_fill()
paisley()
t.end_fill()
for i in range(number_of_paisleys): #Loop to draw color-filled circles on drawn paisleys
t.penup()
t.home()
t.left(((1 + i) * 360 / number_of_paisleys))
t.forward(65)
t.right(90)
t.pendown()
t.fillcolor("magenta")
t.begin_fill()
t.circle(22.5)
t.end_fill()
t.hideturtle()
screen.exitonclick()

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

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

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

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