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___________ # 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") color("black", "red")
begin_fill() begin_fill()
forward(40) circle(r,180) # half circle
right(90) circle(-r,180) # another half circle
forward(20) circle(-r*2,180)
right(90)
forward(40)
right(90)
forward(20)
end_fill() end_fill()
penup() color("black", "blue")
backward(20)
right(180)
color("black","blue")
begin_fill() begin_fill()
forward(20) circle(-r*2,180)
left(90) right(180)
forward(40) circle(r,180) # half circle
left(90) circle(-r,180) # another half circle
forward(20)
end_fill()
end_fill()
input() input()