Code written for Foundations of Computer Graphics with for BerkeleyX.