"""
Ch9 Q4
Draw a semicircle 
"""
import matplotlib.pyplot as plt
def circle(r):
    x = []
    point = -r
    for i in range(101):
        point = -r + i*r/50
        x.append(point)
    y = []
    for i in x:
        y.append((r**2-i**2)**.5)
    plt.plot(x,y,'b')
    
    """
    The following code is to draw the other half.
    
    """
    yy = []
    for i in x:
        yy.append(-(r**2-i**2)**.5)
    
    plt.plot(x,yy,'b')
    
circle(10)
    
    
    


