Compare commits

...

4 Commits

Author SHA1 Message Date
Seoyeon Lee
07fa32f8a5 I made multiple different trials. Major change is adding trigrams and changing codes a bit for the circles.
I realized that I was using two different references for the flag. Both are correct; one I used for my second version, it shows ratios for the measurment, using something like 1, (1/2), (1/4). The one Dr. Proctor shared with me was using bigger numbers for the measurement such as 12, 24, and 6.
When I realized that the taeguk pattern is much bigger than it should be when I draw 건(gun), I realize that my code needs to be revised to make my circles smaller.
I had to think of the usage of 'wdith' and 'unit' in the code. It took a while for me to figure things out.
I did not want to change the fuction Dr. Proctor created, so I make adjustment of my previous work.
I think of how this work would related to math learning or appying math skills. I used arc tangent to figure the angle I need to make for a turtle. I use the center of the big circle as one of a vertex of a right triangle and use the measurement of right trangle (with base 36 and height 24). That's how I got 33.69 degrees, and this was important information for me to move my turtle to the starting point of Dr. Proctor's Trigram fuction.
A strategy I used consistently is that making lots of sketchy work on the piece of paper.
I think of a couple different ways to do math using Taegukgi for elementary or middle schooler. So far just ideas, but I am hoping I can make actual lesson plans and use as an example for an culturally relevant lessons in math class. We can start with korean Flag, but I am sure there are many different flags we can try as well.
I have not been able to make any motions in this drawing project. I wonder if I can make the flag to be waved or try to make the flag looking like fluttering in the wind, but I am pretty sure it requires much more advanced skills.
I am sure I probably have many typos and mistakes here, but somehow this black screen for code makes me care less about me making typoes and errors. haha, I don't know why,  but typing here feels very different from typing on word or google doc.
This activity makes me feel much more comfortable to do 'try and see' without having a clear plan. I did many small changes and see how little changes I made worked or not worked.
2024-10-02 23:33:16 -04:00
Chris Proctor
efc30142a6 Add trigram function and test script 2024-09-30 09:07:12 -04:00
Seoyeon Lee
cd13f96603 I made a second attempt for the same work, the circle with yinyang shape with two colors. I tried to use a fuction.
I name the fuction I use tadpole because the half of circle looks like a tadpole with a big head and a short tale.
For the parameter of the tadpole was radius and color intially, but I ran into the error. So, I had to add 'u' and name it again colour. Since color was already fuction defined by turtle.
I started with right 15 degrees to make more close to Korean flag.
I wonder if it is possible to make the circle with red and blue I made can be spinning. If it's possble, can I decide how many times the circle spins and how fast it spins?
My first attempt was fine, it showed the image I wanted to see, but I think this second attempt was better.
2024-09-28 22:48:58 -04:00
Seoyeon Lee
1a09cc4b18 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.
2024-09-28 21:41:24 -04:00
6 changed files with 175 additions and 20 deletions

Binary file not shown.

28
drawing old.py Normal file
View File

@@ -0,0 +1,28 @@
# drawing.py
# ----------
# By Seoyeon___________
#
# (second trial_use fuction_center of Korean flag with two colors)
from turtle import *
def tadpole (radius,colour): # "I name half of yinyang shape tadpole"
color("black", colour) # British spellings for colour to distinguish this from color"
begin_fill()
circle(radius,180) # half circle
circle(-radius,180) # another half circle
circle(-radius*2,180)
end_fill()
right(15)
left(90)
tadpole (40, "red")
right(90)
penup()
forward(160)
pendown()
left(90)
tadpole (40, "blue")
input()

View File

@@ -2,31 +2,62 @@
# ----------
# By Seoyeon___________
#
# (basic practice prior to yin-yang shape.)
# (Final Version_adding trigram, adding color code)
from turtle import *
color("black", "red")
from trigram import draw_trigram
def tadpole (width,colour): # "I name half of yinyang shape tadpole"
color("black", colour) # British spellings for colour to distinguish this from color"
begin_fill()
forward(40)
right(90)
forward(20)
right(90)
forward(40)
right(90)
forward(20)
circle(1/2 * width,180) # half circle
circle(-1/2 * width,180) # another half circle
circle(-1 * width,180)
end_fill()
width=100
penup()
backward(20)
right(180)
color("black","blue")
begin_fill()
forward(20)
forward(1/2 * width)
right(90)
forward(1*width)
left(90)
forward(40)
left(90)
forward(20)
end_fill()
circle(-2 * width, 33.69)
pendown()
tadpole (width, "#CD2E3A")
right(90)
penup()
forward(2* width)
pendown()
left(90)
tadpole (width, "#0047A0")
left(90)
penup()
forward(1/2 * width)
pendown()
draw_trigram ([True, True, True], width)
right(180)
penup()
forward( (6+12+12+6) / 12 * width)
draw_trigram ([False, False, False], width)
left(90)
penup()
circle(18 /12 * width, 33.69*2)
right(90)
draw_trigram ([False, True, False], width)
right(180)
penup()
forward( (6+12+12+6) / 12 * width)
draw_trigram ([True, False, True], width)
input()

28
drawing_old.py Normal file
View File

@@ -0,0 +1,28 @@
# drawing.py
# ----------
# By Seoyeon___________
#
# (second trial_use fuction_center of Korean flag with two colors)
from turtle import *
def tadpole (radius,colour): # "I name half of yinyang shape tadpole"
color("black", colour) # British spellings for colour to distinguish this from color"
begin_fill()
circle(radius,180) # half circle
circle(-radius,180) # another half circle
circle(-radius*2,180)
end_fill()
right(15)
left(90)
tadpole (40, "red")
right(90)
penup()
forward(160)
pendown()
left(90)
tadpole (40, "blue")
input()

12
test_trigram.py Normal file
View File

@@ -0,0 +1,12 @@
from turtle import left
from trigram import (
draw_trigram,
,
,
,
,
)
left(90)
draw_trigram([True,False,False], 200)
input()

56
trigram.py Normal file
View File

@@ -0,0 +1,56 @@
from turtle import *
= [True, True, True]
= [False, False, False]
= [True, False, True]
= [False, True, False]
def draw_trigram(pattern, width):
"""Draws a trigram from the Korean flag.
The starting and ending point is the center of the bottom of
the trigram, with the turtle facing up.
The pattern should be a list of True/False values, indicating
whether each bar should be solid, starting from the top.
"""
unit = width/12
for bar_type in pattern:
draw_trigram_bar(bar_type, width)
fly(unit * 3)
fly(unit*-9)
def draw_trigram_bar(is_solid, width):
"""Draws a single bar from a trigram, starting and ending at the center
of the bottom of the bar.
"""
unit = width/12
right(90)
fly(unit*-6)
if is_solid:
draw_black_rectangle(unit*12, unit*2)
fly(width/2)
else:
draw_black_rectangle(unit*5.5, unit*2)
fly(unit*6.5)
draw_black_rectangle(unit*5.5, unit*2)
fly(unit*-0.5)
left(90)
def draw_black_rectangle(width, height):
"""Draws a filled black rectangle, starting and ending at the bottom
left corner and turning to the left.
"""
color('black')
fillcolor('black')
begin_fill()
for half in range(2):
forward(width)
left(90)
forward(height)
left(90)
end_fill()
def fly(steps):
"Move without drawing"
penup()
forward(steps)
pendown()