code for chapter 1,2,3. computer graphics by F.S Hill jr.