The capital letter A turned out to be a bit tougher than I expected.
After drawing the letter on graph paper, I realized the angles would not
all be 45 degrees, so I used some trigonometry to figure out the angle.
This got more difficult in the inner part of the A, but I was still able
to define this angle. For the horizontal parts in the middle of the A,
I had to trial and error the distances, because it was hard to tell
exactly where I was on the grid, but overall I think the letter turned
out well. I think I'll try something with more linear motions for the
next letter and then maybe some more diagonals and maybe a curve for
the last 2 letters.
This commit is contained in:
Chris Mekelburg
2024-09-21 11:40:40 -04:00
parent 0c7e222092
commit 7e3cafa490

View File

@@ -11,9 +11,54 @@
from turtle import *
from math import sqrt
from math import atan
from math import degrees
def draw_letter_a(unit):
pass
outer_angle = degrees(atan((3*unit)/(8*unit))) #defines outer angle turns in degrees
inner_angle = degrees(atan((7*unit)/(3*unit))) #defines inner angle turns in degrees
outer_side = unit*sqrt(73) #length of outer part of letter A
inner_side = unit*sqrt(58) #length of inner part of letter A
left(90-outer_angle)
forward(outer_side)
right(90-outer_angle)
forward(unit*2)
right(90-outer_angle)
forward(outer_side)
right(90+outer_angle)
forward(unit)
right(inner_angle)
forward(.43*inner_side)
left(inner_angle)
forward(3.4*unit)
penup()
back(3.4*unit)
right(inner_angle)
forward(.14*(inner_side))
pendown()
left(inner_angle)
forward(2.6*unit)
penup()
back(2.6*unit)
right(inner_angle)
pendown()
forward(.43*(inner_side))
left(2*inner_angle)
forward(.43*(inner_side))
penup()
forward(.14*(inner_side))
pendown()
forward(.43*(inner_side))
right(inner_angle)
forward(unit)
right(180)
def draw_letter_b(unit):
pass