Finding the Focus of a Lens System

Optica has two built-in functions for determining the focal point of any arbitrary imaging system, FindFocus and FindFocusFast. To see how FindFocus works, we measure the focus of a simple planoconvex lens. First, we draw the system. To make the focal point measurement more challenging, we use off-axis rays.

offaxis = DrawSystem[{
	Move[LineOfRays[30,NumberOfRays->7],{75,0,10}],
	Move[PlanoConvexLens[100,50,10],{100,0,0}],
	Boundary[{0,-100,-100},{250,100,100}]}];

Now we use FindFocus for measuring the off-axis focal point. We must specify a surface for FindFocus to begin its search. In this example, we use a Boundary surface (ComponentNumber->2) as the starting surface.

FindFocus[offaxis,ComponentNumber->2]