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

Simple Python Turtle Graphic and Code : Division Symbol (Gradient)

The two dots or circles and bar of a division symbol created with lines transitioning in color from green to blue repeatedly. The code for gradient drawing here uses integral values for r, g, and b, and is easier to follow than the code I used for Exclamation Point, Goblet, and the like in my earlier uploads.

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.speed(5)
screen.colormode(255) #Requirement to use integers 0 to 255 for r, g, and b values
size_of_graphic = 240 #The integral y value of graphic's top endpoint
x = 0
def circle(a, z): #Procedure for drawing the dot or circle in division symbol
r = b = 0 #This and next line: Initialization of color to (0, 255, 0) or "green"
g = 255
circle_center_y = (a + z) / 2 #y-coordinate of dot or circle center;
radius = (a - z) / 2 #Radius of dot or circle, which has a and z as max and min y values
for y in range(a, z, -1): #Loop to draw horizontal lines as y changes in value from a to z
t.pencolor(r, g, b) #Assignment of color for current horizontal line
x = abs((radius ** 2 - (y - circle_center_y) ** 2) ** (1 / 2)) #The positive value of x in circle equation
t.goto(-x, y) #Starting point for current horizontal line
t.forward(2 * x) #Drawing of current horizontal line with length 2x
g -= 2 #Change in green shade from 255 initially to lower values as loop iterates
b += 2 #Change in blue shade from 0 initially to higher values as loop iterates
def bar(a, z): #Procedure for drawing the division bar, which has max a and min z as y values
r = b = 0 #This and next line: Initialization of color to (0, 255, 0) or "green"
g = 255
for y in range(a, z, -1): #Loop to draw the horizontal lines as y changes in value from a to z
t.pencolor(r, g, b) #Assignment of color for current horizontal line
x = size_of_graphic #Value of x in dividsion bar
t.goto(-x, y) #Starting point for current horizontal line
t.forward(2 * x) #Drawing of current horizontal line with length 2x
g -= 4 #Change in green shade from 255 initially to lower values as loop iterates
b += 4 #Change in blue shade from 0 initially to higher values as loop iterates
t.penup() #Python_Graphic start of drawing procedure
t.goto(x, size_of_graphic) #Trail-less movement of turtle to top endpoint of upper dot or circle in graphic
t.pendown()
circle(size_of_graphic, size_of_graphic // 2) #Function call to draw the upper dot or circle in division symbol
t.penup()
t.goto(x, size_of_graphic // 8) #Trail-less movement of turtle to top endpoint of division bar in graphic
t.pendown()
bar(size_of_graphic // 8, -size_of_graphic // 8) #Function call to draw the division bar in graphic
t.penup()
t.goto(x, -size_of_graphic // 2) #Trail-less movement of turtle to top endpoint of lower dot or circle in graphic
t.pendown()
circle(-size_of_graphic // 2, -size_of_graphic) #Function call to draw the lower dot or circle in division symbol
t.hideturtle()
screen.exitonclick()

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

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

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

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