From a rectangle to a circle (yin yang kind shape)

I failed multiple times. Making the red (upper part of circle) was fairly easy. But, another half with blue was harder than I thought.
While I was expereincing some failures, I got a new idea. I wanted to create a new identical upper circle shape and rotate it to put it under the red upper circle, but I don't know how to do rotate the identical new figure using the point the pen stops as a center of rotation. I don't know if it's even possible. So, I just keep trying my original plan, which was just using a big half circle and two half circles.
This commit is contained in:
Seoyeon Lee 2024-09-28 21:41:24 -04:00
parent d90f4c90c9
commit 1a09cc4b18
1 changed files with 14 additions and 19 deletions

View File

@ -2,31 +2,26 @@
# ----------
# By Seoyeon___________
#
# (basic practice prior to yin-yang shape.)
# (center of Korean flag with two colors, red and blue)
from turtle import *
from turtle import *
r=40
left(70)
color("black", "red")
begin_fill()
forward(40)
right(90)
forward(20)
right(90)
forward(40)
right(90)
forward(20)
circle(r,180) # half circle
circle(-r,180) # another half circle
circle(-r*2,180)
end_fill()
penup()
backward(20)
right(180)
color("black","blue")
color("black", "blue")
begin_fill()
forward(20)
left(90)
forward(40)
left(90)
forward(20)
end_fill()
circle(-r*2,180)
right(180)
circle(r,180) # half circle
circle(-r,180) # another half circle
end_fill()
input()