Work 2: Because it's time, you'll make a line.

posted Feb 9, 2017, 11:14 AM by JonAlf Dyrland-Weaver   [ updated Feb 15, 2017, 7:47 AM ]
DUE: 8am Thursday 2/16

You will write your own line algorithm!
  1. First decide what you will be programming in for this assignment. You can use any language you'd like, but you must write your own line algorithm (do not use any built in function that may exist for your language of choice).
    • I have provided frameworks for both c and python, these can be found here:
    • In order to save an image in a non ppm format, or display the image, you must have imagemagick installed
  2. Code Bresenham's line algorithm!
    • Start with octant 1.
    • Add the other octants one at a time, you'll have a much easier time debugging doing that.
  3. Test your algorithm by calling your draw line routine multiple times.
  4. Don't forget to upload an image to the gallery.

Follow these guidelines in your submission
  • Upload your code to gihub
  • Upload an image to the gallery
  • Include a makefile with a “make run” target
    • The make run target should run your code (compile if necessary)
    • Your code should result in displaying an image that tests all octants, including 0, 1, -1 and undefended slopes. If you cannot run the display command, then save an image and print out the name of the image being saved.
    • This image may not be the same as your gallery image, that is ok.
If your are using my frameworks you only need to modify the following files:
  • c
    • draw_c
    • main_c
  • python
github clone link: