Function Repository Resource:

ThickLensManipulate

Source Notebook

Generate a graphic in which the thick-lens parameters can be manipulated dynamically

Contributed by: Julián Laverde
Jason Martinez

ResourceFunction["ThickLensManipulate"][]

returns a manipulable graphic of the ray diagram of a thick lens.

ResourceFunction["ThickLensManipulate"][assoc]

returns a graphic with the corresponding parameters in the Association assoc.

Details and Options

The available type thick lenses are biconvex, plano-convex, meniscus, plano-concave, and biconcave.
ResourceFunction["ThickLensManipulate"] follows the sign convention for thick lenses from Hecht, Optics, Pearson, 2015:
Object distance (+) real object(-) virtual object
Image distance (+) real image(-) virtual image
Object size(+) erect object(-) inverted object
Image size(+) erect image(-) inverted image
Magnification (M)(+) erect image(-) inverted image
The linear magnification factor of the system is given by the equation defined as the ratio of the size of the image compared to the size of the object.
ResourceFunction["ThickLensManipulate"] uses the lensmaker’s equation to calculate the focal length f of a thick lens in air, where n is the lens refractive index, and d, R1 and R2 are the lens thickness, and radii of curvature of the lens surfaces respectively, as shown in the following figure:
The arrow in the middle of the rays represents the direction of light and dotted lines the projection of the rays.
Real images and virtual images are represented by a thick-line arrow and a dotted-line arrow, respectively.
In ResourceFunction["ThickLensManipulate"][assoc], the Association assoc can contain the following elements:
"LensThickness"5initial lens thickness
"Radius1"3initial radius of the first surface encountered by light, as a multiple of lens thickness
"Radius2"-3initial radius of the second surface encountered by light, as a multiple of lens thickness
"RefractiveIndex"1.5initial refractive index of the lens
"ObjectSize"0.5initial object size
"ObjectDistance"FocalLengthinitial object position
"LensThickness" and "ObjectDistance" can be a positive numbers or quantities of length.
"RefractiveIndex" can be a number in the range[1,3].
"Radius2" can be Infinity for plano-concave and plano-convex lenses.
"ObjectSize" can be a number in the range [0,1].
Quantity inputs should have units of length. Results and values in sliders will be shown in the most common unit among the inputs.
ResourceFunction["ThickLensManipulate"][] takes the options of Graphics and the following:
"RayColor"Automaticspecify the colors of the rays
"LensColor"Automaticspecify the color of the lens
"ArrowColor"Automaticspecify the colors of the object and image arrows
"ShowEquations"Trueset the equations in the graphics object
"ObjectDistanceRange"Automaticspecify the range of "ObjectDistance"
"ObjectSizeRange"Automaticspecify the range of "ObjectSize"
"Radius1Range"Automaticspecify the range of "Radius1"
"Radius2Range"Automaticspecify the range of "Radius2"
"RefractiveIndexRange"Automaticspecify the range of "RefractiveIndex"
"LensThicknessRange"Automaticspecify the range of "LensThickness"
The copy values button copies the current values of "ObjectDistance", "FocalLength", "ImageDistance", and "Magnification" to the clipboard as an Association.

Examples

Basic Examples (1) 

Get a manipulable thick lens ray diagram:

In[1]:=
ResourceFunction["ThickLensManipulate"][]
Out[1]=

Scope (6) 

Get the ray diagram for a biconcave lens:

In[2]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> -20, "Radius2" -> 25, "RefractiveIndex" -> 1.2, "LensThickness" -> 5|>]
Out[2]=

Get the ray diagram for a plano-convex lens:

In[3]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> 30, "Radius2" -> Infinity, "RefractiveIndex" -> 1.2, "LensThickness" -> 6|>]
Out[3]=

Include inputs with quantities:

In[4]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> Quantity[300, "Centimeters"], "Radius2" -> Quantity[-300, "Centimeters"], "RefractiveIndex" -> 1.5, "LensThickness" -> Quantity[ 5, "Millimeters"]|>]
Out[5]=

Get the ray diagram for a plano-concave lens:

In[6]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> -30, "Radius2" -> Infinity, "ObjectSize" -> 0.8|>]
Out[6]=

Get the ray diagram for a negative meniscus lens:

In[7]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> 30, "Radius2" -> 20, "ObjectSize" -> 0.6|>]
Out[7]=

Get the ray diagram for a positive meniscus lens:

In[8]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> 16, "Radius2" -> 49, "ObjectSize" -> 0.8, "ObjectDistance" -> 80|>]
Out[8]=

Options (10) 

ShowEquations (1) 

Set "ShowEquations" to False:

In[9]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> 16, "Radius2" -> -25, "ObjectSize" -> 0.8|>, "ShowEquations" -> False]
Out[9]=

RayColor (1) 

Change the color of the rays:

In[10]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> -25, "Radius2" -> 45|>, "ShowEquations" -> False, "RayColor" -> {Darker[Green], Blue, Orange}]
Out[10]=

ArrowColor (1) 

Change the color of the object and virtual arrows:

In[11]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> -45, "Radius2" -> 45|>, "RayColor" -> {Darker[Green], Blue, Orange}, "ArrowColor" -> {Gray, Red}]
Out[11]=

LensColor (1) 

Specify the color of the lens:

In[12]:=
ResourceFunction[
 "ThickLensManipulate"][<|"Radius1" -> 25, "Radius2" -> 45|>, "LensColor" -> {Blue}]
Out[12]=

ObjectDistanceRange (1) 

Specify the range of "ObjectDistance":

In[13]:=
ResourceFunction["ThickLensManipulate"][<|"ObjectDistance" -> 45|>, "ObjectDistanceRange" -> {40, 60}]
Out[13]=

ObjectSizeRange (1) 

Specify the range of "ObjectSize":

In[14]:=
ResourceFunction["ThickLensManipulate"][
 "ObjectSizeRange" -> {0.4, 0.6}]
Out[14]=

Radius1Range (1) 

Specify the range of "Radius1":

In[15]:=
ResourceFunction["ThickLensManipulate"][<|"Radius1" -> 35|>, "Radius1Range" -> {30, 40}]
Out[15]=

Radius2Range (1) 

Specify the range of "Radius2":

In[16]:=
ResourceFunction["ThickLensManipulate"][<|"Radius2" -> - 35|>, "Radius2Range" -> {30, 45}]
Out[16]=

RefractiveIndexRange (1) 

Specify the range of "RefractiveIndex":

In[17]:=
ResourceFunction["ThickLensManipulate"][<|"RefractiveIndex" -> 1.8|>, "RefractiveIndexRange" -> {1.8, 2.5}]
Out[17]=

LensThicknessRange (1) 

Specify the range of "LensThickness":

In[18]:=
ResourceFunction["ThickLensManipulate"][
 "LensThicknessRange" -> {3, 8}]
Out[18]=

Publisher

WolframSpecialProjects

Version History

  • 1.1.0 – 12 September 2022
  • 1.0.0 – 14 June 2021

Source Metadata

Related Resources

License Information