# ShowDisk.py """ Ilustrates the procedure DrawDisk. """ from simpleGraphics import * # Create a figure with a plot window that displays # the region -d<=x<=d, -d<=y<=d d = 8 MakeWindow(8,bgcolor=BLACK,labels=False) # Draw six disks that are tangent to each other with centers # on the x-axis. # Initial (leftmost) disk. x = -4.0 r = 4.0 DrawDisk(x,0,r,color=MAGENTA,stroke=0) # Disk 2 # The center of the next disk is 1.5r to the right of the # center of the current disk. x = x + 1.5*r r = r/2 DrawDisk(x,0,r,color=CYAN,stroke=0) # Disk 3 x = x + 1.5*r r = r/2 DrawDisk(x,0,r,color=MAGENTA,stroke=0) # Disk 4 x = x + 1.5*r r = r/2 DrawDisk(x,0,r,color=CYAN,stroke=0) # Disk 5 x = x + 1.5*r r = r/2 DrawDisk(x,0,r,color=MAGENTA,stroke=0) # DIsk 6 x = x + 1.5*r r = r/2 DrawDisk(x,0,r,color=CYAN,stroke=0) ShowWindow()