# ShowLineSeg.py # Illustrates the procedure DrawLineSeg from simpleGraphicsE import * import math # Draw x and y axes n = 8 MakeWindow(n,bgcolor=PINK,labels=True) # DrawLineSeg(???) # DrawLineSeg(???) # Draw a pizza with 4 toppings: CYAN, PINK, PURPLE, YELLOW # Proceed by drawing 360 colored ``spokes'' n = 4 MakeWindow(n,bgcolor=BLACK) for k in range(0,360): # Replace the "no op" pass statement so that # a line segment with heading k degrees is drawn with the rightcolor pass # A Rhombus is a quadrilateral with four equal sides. # In a Rhombus, opposite angles are equal n = 8 MakeWindow(n,bgcolor=WHITE,labels=True) L = 7 theta = 55 x0 = -4 y0 = -2 # Here are two of the sides DrawLineSeg(x0,y0,L,0,linecolor=BLACK) DrawLineSeg(x0,y0,L,theta,linecolor=BLACK) # The vertex opposite (x0,y0) is (x1,y1) where x1 = x0+L+L*math.cos(theta*math.pi/180) y1 = y0+L*math.sin(theta*math.pi/180) # Here are the other two sides # DrawLineSeg(???) # DrawLineSeg(???) ShowWindow()