Draw Ovals

#! /usr/bin/python3
# ===================================================================
# draw ovals
# coordinates are window coordinates
# ===================================================================

import user_interface as ui
import draw_xy_axes as ax
from graphics import *

# ---- create window

win = GraphWin("Ovals", 801, 801)
win.setBackground("white")

# ---- draw X,Y coordinate axes

ax.draw_xy_axes(win,True)

# ---- draw oval #1

cx = 801/3                     # window center x coord
cy = 801/3                     # window center y coord

bb1 = Point(cx-100,cy-50)      # bounding box
bb2 = Point(cx+100,cy+50)      # bounding box

o = Oval(bb1,bb2)
o.setOutline('black')
o.setWidth(5)
o.setFill('red')
o.draw(win)

# ---- draw oval #2

cx = 801*2/3                   # window center x coord
cy = 801*2/3                   # window center y coord

bb1 = Point(cx-50,cy-100)      # bounding box
bb2 = Point(cx+50,cy+100)      # bounding box

o = Oval(bb1,bb2)
o.setOutline('black')
o.setWidth(5)
o.setFill('blue')
o.draw(win)

# ---- end program

ui.pause()

win.close()
print()