This is from the book Raytracing In One Weekend by Peter Shirley, Trevor David Black and Steve Hollasch.