subject

Using graphics. py to draw an American flag. Your flag should be draw according to the standard proportions for the Unites States Flag found on www. usflag. org/flag. specs. html. this is what i have so far
import time
from graphics import *
from math import *

def main():
conv=400
stripetop=0
A=1.0
B=1.9
C=0.5385
D=0.76
E=0.054
F=0.054
G=0.063
H=0.063
K=0.0616
L=0.0769
win=GraphWin('Flag',1.9*conv,1*conv )
#stripes
for cntr in range(0,13):
s=Rectangle(Point(0,stripetop), Point(B*conv, stripetop+(L*conv)))
s. setOutline("black")
s. setWidth(1)
s. draw(win)
stripetop=stripetop+L*conv
if cntr%2==0:
s. setFill("red")
else:
s. setFill("white")

#union
u=Rectangle(Point(0,0),Point(D*conv , C*conv))
u. setFill("blue")
u. setOutline("black")
u. setWidth(1)
u. draw(win)

#defining the angles used for the star, then converting to radians
a1=(360/5)
a2=(a1/2)
a3=(180-a1)
a4=(a3/2)
a5=(180-90-a4)
a6=(a3-2*a5)
a7=(a6/2)

a1=radians(a1)
a2=radians(a2)
a3=Radians(a3)
a4=radians(a4)
a5=radians(a5)
a6=radians(a6)
a7=radians(a7)

#defining the lenths needed to define the points fof the star
M=abs(2*((K/2)*sin(a2)))
N=abs(M*sin(a5))
O=abs((K/2)-N)
P=abs((K/2)*sin(a1))
Q=abs(O*tan(a2))
R=abs((K/2)*sin(a4))
S=abs((Q*K)/M)
T=abs((2*Q*O)/M)
U=abs(M/2)
V=abs((2*Q*P)/M)

star=Polygon(Point(0,K/2),Point(Q, O),Point(P, O),Point(V,-T),
Point(U,-R),Point(0,-S),Point(-U,-R ),Point(-V,-T),
Point(-P, O),Point(-Q, O))

main()
How do I get the stars to go where they need to when i run it the flag shows up but now stars, what do you see that I may not see. thanks in advance

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
How does a policy manual an organization? a. it boost productivity. b. it create awareness in employees about the organization’s values. c. it employees achieve targets. d. it safeguards the organization from liabilities.
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 23.06.2019 06:10
The head restraint should be adjusted so that it reaches a.the top of your ears b.the base of your skull c.the top of the head
Answers: 1
question
Computers and Technology, 25.06.2019 06:00
Sam needs to create a spreadsheet for his coworkers. they will need to follow a crossed a long road of data. sam would like to make his spreadsheet easy to read. sam should
Answers: 1
You know the right answer?
Using graphics. py to draw an American flag. Your flag should be draw according to the standard prop...
Questions
question
Mathematics, 31.01.2020 09:50
Questions on the website: 13722361