Algorithms for Graphics; codes from the book Graphics Gems