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

Simple Python Turtle Graphic and Code Brig Gen Insignia

📁 Обучение 👁️ 17 📅 08.12.2023

A General's star created with the "math" library to be able to use trigonometric functions and pi.

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 url at https://www.amazon.com/author/basicpythonturtleart.url

import turtle
import math #Requirement to use trigonometric functions and pi
t = turtle.Turtle() #Definitions and Initializations
screen = turtle.Screen()
t.pensize(4)
star_size = 260 #Changeable; Distance from center to upper tip of star
t.penup() #Python_Graphic start of drawing procedure
t.left(90) #Turtle rotation to point toward upper tip of star
t.forward(star_size) #Trail-less movement of turtle over a distance of star_size
t.right(162) #Turtle rotation toward upper-right boundary of star's "head"
t.pendown() #Preparation to draw star outline
t.fillcolor("silver") #Setting of fill color for star
t.begin_fill()
for i in range(5): #Loop to draw the five "v" boundaries of star: NorthEast, SE, S, SW, and NW
t.forward(star_size * math.sin(math.pi * 36 / 180) / math.sin(math.pi * 126 / 180)) #The left arm of "v"
t.left(72)
t.forward(star_size * math.sin(math.pi * 36 / 180) / math.sin(math.pi * 126 / 180)) #The right arm of "v"
t.right(144)
t.end_fill()
t.pensize(2) #Change of pensize for the inner ridges of star
t.setheading(90) #Initial turtle direction before drawing the inner ridges
for i in range(5): #Loop to draw 5 pairs of inner ridges; a pair containing a long and a short ridge
t.penup()
t.goto(0, 0)
t.pendown()
t.forward(star_size) #Turtle movement to draw a long ridge
t.right(36)
t.penup()
t.goto(0, 0)
t.pendown()
t.forward(star_size * math.sin(math.pi * 18 / 180) / math.sin(math.pi * 126 / 180)) #Turtle movement to draw a short ridge;
t.right(36) #sine((18/180) of pi) and sine((126/180) of pi) from law of sines on an 18-36-126 triangle,
t.hideturtle() #the longest side of which has length star_size, and the two shorter sides have lengths
screen.exitonclick() #of "v" arms

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

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

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

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