# Picture

import ecs10graphics07 as gr
import math

# Define graphics window
gr.begin_graphics(500,500,gr.Color.pink,"Picture")

# Pick up purple crayon
gr.set_Color(gr.Color.purple)

# Define a big circle
radius = 200
center = [250,250]
angle = 0  # Angle can be between zero and 2 Pi
while angle < math.pi/3:

    # Find position of the point on the circle for that angle
    x = center[0] + radius*math.cos(angle)
    y = center[1] + radius*math.sin(angle)

    # Draw the circle using the graphics library
    gr.circle(x,y,4,filled=True)
    # Increase the angle by a little bit each time
    angle = angle+math.pi/15

# Pause to allow graphics window to process commands, window
# move, window kill, all that stuff. 
# After every pause, alive will be True if the graphics window
# is still there, False after it gets killed. 
alive = True
while alive:
    alive = gr.sleep(.05)

gr.end_graphics()
