CPSC120 Lab 3

Turtle Graphics

  1. Draw a Parabola

    Create a function called draw_parabola in a file called parabola.py. The function should draw the function y = x2 / 100 with the domain  − w / 2 < x < w / 2 and the range  − h / 2 < y < h / 2, where w and h are the width and height of the canvas. The functions window_height and window_width in the turtle module can be used to get the dimensions of the window.

  2. Draw a Circle at a Location

    Create a function called draw_circle_at in a file called circle.py. The function should draw a circle of the specified radius at the specified location. The function should vary the number of edges that make up the circle so that small circles have fewer sides and large circles have more sides. An easy way to do this is to assume that the side length is 1. Do not uset the circle function in the turtle module.

  3. Draw a Fish

    Create a function called draw_fish_at in a file called fish.py. The function should draw a fish, like the one below.

    The function parameters should specify the width of the fish and the location of the center of the fish. You can use the turtle module’s circle function to draw the fish.


Submit a zip file of your code on the course Inquire site that uses your last names as the file name.