def flag_czech(): world=World() canvas=world.ca(width=1500, height=500, background='white') points = [[0,00], [150, -100], [0, -200]] canvas.polygon(points, fill='blue4') points=[[0,00],[500,00],[500,-100],[150,-100],[0,00]] canvas.polygon(points, fill='white', outline='black') points=[[150,-100],[500,-100],[500,-200],[0,-200],[150,-100]] canvas.polygon(points, fill='red',outline='black') world.mainloop()
def draw_circle(cir): hello = World() e = hello.ca(width=window.width, height=window.height, background=window.color) e.circle([cir.point.x, cir.point.y], cir.radius, outline="green", fill="black") hello.mainloop()
def main(): box = rectangle() box.width = 100.0 box.height = 200.0 box.ll = point() box.ll.x = 10.0 box.ll.y=10.0 box.ur = point() box.ur.x = 200.0 box.ur.y=200.0 box.color='red' bbox=[[box.ll.x,box.ll.y],[box.ur.x,box.ur.y]] world=World() canvas=world.ca(width=500, height=500, background='white') draw_rectangle(canvas,box) draw_point(canvas,box.ll) circle=Circle() circle.center=point() circle.center.x=100.0 circle.center.y=100.0 circle.radius=10.0 draw_circle(canvas,circle) world.mainloop()
rect1=Rectangle() rect2=Rectangle() rect1.color='white' rect2.color='red' dimensions(rect1,300,100) dimensions(rect2,300,100) corner(rect1,-150,0) corner(rect2,-150,-100) print (find_center(rect1)) circle=Circle() center(circle,-25,0) circle.radius=70 circle.color='blue' world=World() canvas = world.ca(width=500, height=500, background='white') draw_point(canvas,point1) draw_rectangle(canvas, rect1) draw_rectangle(canvas, rect2) points=[[-150,-100],[-150,100],[-150+(100*(3**0.5)),0]] canvas.polygon(points,fill='blue') world.mainloop()