shapes2d.py
, submitted on Canvas.Note that it's important to always use exactly the specified filename when handing in work for a CS class. (Canvas may automatically append a number to your filename; that's okay.)
polylineXAxis()
so that it matches the TODO comment. Test this by changing the call to the function in main()
, giving it a higher K
value.main()
where you call polylineXAxis()
so that the line appears in quadrant 1 of the plane (upper right).polylineVee()
so that it matches the TODO comment. Put a call into main()
so that a V shape appears in quadrant 2 (upper left).polygonSquare()
so that it matches the TODO comment. Put a call into main()
so that a square appears in quadrant 3 (lower left).
polygonCircle()
so that it matches the TODO comment. Put a call into main()
so that a circle appears in quadrant 4 (lower right).I will test your functions with many different values of K, including 0. (I won't use negative, fractional, or non-numeric values; don't worry.) Make sure you verify that your functions work correctly in all cases.
In the end, your goal is to produce a figure that looks something like this. Note that I've chosen a different K value for each shape, so that the points are not too crowded but not too sparse. The K values for the line, V, square, and circle, respectively, are 4, 4, 3, and 10.
This assignment is worth 15 points.
Criterion | Points |
---|---|
Program runs from command line as python shapes2d.py . | 1 |
Displays window and keeps it open. | 1 |
Shows line in quadrant 1, with points along the middle. | 1 |
Shows V in quadrant 2, with points along the edges. | 1 |
Shows square in quadrant 3, with points along the edges. | 1 |
Shows circle in quadrant 4, with points along the circumference. | 1 |
polylineXAxis() returns correct values for several arguments. | 2 |
polylineVee() returns correct values for several arguments. | 2 |
polygonSquare() returns correct values for several arguments. | 2 |
polygonCircle() returns correct values for several arguments. | 2 |
Points in square and circle are arranged in the correct order. | 1 |
Total | 15 |