In this project, a biconvex spherical lens was added to the pinhole in program 4, performing importance sampling to provide faster rendering. I used the thin lens equation provided on wikipedia.
Project 5 - Thin Lens Camera
Both spheres in focus.
Using focal distance 0.75
Both spheres out of focus. Focal dist. = 0.9
Red sphere in focus. Yellow sphere blurred.
Results
For the third image, I moved the light sphere to position (0.0, 2.0, 0.0) and reduced the radius of the yellow sphere to 0.3.