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, 24.06.2019 09:10
  to change the number of rows and columns displayed by the excel object a. select the object and drag a size handle on the active object. b. deselect the object and drag a size handle of the object. c. deselect the object and drag a row or column divider of the object. d. select the object and drag a row or column divider on the active object.
Answers: 2
question
Computers and Technology, 24.06.2019 10:20
Identify the publisher in this citation: carter,alan.a guide to entrepreneurship.new york: river’2008.print.
Answers: 3
question
Computers and Technology, 24.06.2019 15:00
Who introduced the concept of combining artificial and natural light in the studio
Answers: 1
question
Computers and Technology, 24.06.2019 18:30
Jacking is a crime that takes place when a hacker misdirects url to a different site. the link itself looks safe, but the user is directed to an unsafe page
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, 06.08.2021 19:40
Questions on the website: 13722360