The purpose of this article is to help those to understand how lenses work through the understanding of ray tracing. For the purpose of this discussion we are only going to deal with thin lenses. Thin Lenses are defined as when the central thickness of a lens is small enough, the converging and diverging properties of the lens in air are independent of the shape or form of the lens as well as the direction in which the light is traveling through the lens.**
This article assumes that the reader has a basic understanding of how to convert meters to millimeters and rearrange a formula to find different values.
Before we begin to trace we are going to draw what looks like a graph (fig.1). The horizontal line represents your Optical Axis and the vertical line represents your Lens. To the left of the vertical line you have negative values, to the right you have positive values, above the horizontal line you have positive values, below you have negative values.

For the purpose of ray tracing light travels from left to right, so an object in front of the lens will be to the left of the vertical line. When an object distance, image distance, or focal length is given it will be measured horizontally from the lens to the object, image, or focal point. When the image height or the object height is given it will be measured vertically from the optical axis to the image height or the object height.
Rules to Remember
- Real objects are located to the left of the lens, so they have a negative value.
- Real images are formed to the right of the lens, so they have a positive value.
- Virtual objects are located to the right of the lens, so they have a positive value.
- Virtual images are formed to the left of the lens, so they have a negative value.
- Images formed below the optical axis have a negative value and are referred to as inverted.
- Images formed above the optical axis have a positive value and are referred to as erect.
- If the linear magnification is greater than 1(negating the sign) then the image is magnified.
- If the linear magnification is less than 1(negating the sign) then the image is minified.
What we are putting on the graph
- Optical Axis This is the horizontal line that is perpendicular to the lens. No refraction takes place as it enters or exits the lens.
- Lens This is the vertical line that represents the lens. A plus lens is drawn with arrows facing away from each other(base to base) and a minus lens is drawn with arrows facing each other(apex to apex). One arrow is put on the top of the line and the other arrow is put on the bottom of the line.

- Optical Center This is the point at which the optical axis intercepts with the lens.

- Primary Focal Point ( f 1 ) This is the point on the optical axis that results in rays leaving the lens parallel to the optical axis. This point is measured from the lens to f 1
- Secondary Focal Point ( f 2 ) This is the point on the optical axis where rays converge or diverge. This point is measured from the lens to f 2

- Object Distance ( p ) This is the point on the optical axis where the object is located. It is measured from the lens to the object distance.
- Object Height ( O )This is measured vertically from the object distance to the height of the object.
- Image Distance ( q )This is the point on the optical axis where the image is located. It is measured from the lens to the image distance. Note if the image distance is negative it is considered virtual, if it is positive it is considered real.
- Image Height ( I ) This is measured vertically from the image distance to the height of the image. Please note if the image height is negative it is inverted and if it is positive it is erect.

Formulas to trace a lens
Primary Focal Point ( f 1 )
f 1=-( 1/D)
f 1 is the Primary Focal Point meausred in Meters
D is the power of the lens measured in Diopters
Secondary Focal Point ( f 2 )
f 2= 1/D
f 2 is the Secondary Focal Point measured in Meters
D is the power of the lens measured in Diopters
Focal Length ( f )
f = 1/D
D is the Dioptric value of the lens
f is the focal length of the lens measured in Meters
Image Distance ( q )
1/q=( 1/f ) + ( 1/p )
q is theimage distance measured in Meters
f is the focal length measured in Meters
p is the object distance measured in Meters
Linear Magnification ( M )
M = q/p
M is linear magnification
q is image distance
p is object distance
Image Height ( I )
I=M * O
I is image height
M is linear magnification
O is object height
Tracing a Plus Lens
Rules for Plus Lenses
- If your object distance is greater than f 1 (neglecting signs) then your horizontal line(optical axis), from lens to object distance, will be as long as your object distance.
- If your image distance is greater than f 2 then then your horizontal line(optical axis), from lens to image distance, will be as long as your image distance.
Example: A +20.00D lens has 10mm tall object placed 100mm in front of the lens. Draw the image formation. Is the image real or virtual, is the image erect or inverted?
Step 1: Find f1 and f2
f 1=−( 1/20 ) =−0.05M=−50mm
f 2= 1/20= 0.05M=50mm
Note f1 is negative so f1 will be located to the left of the lens. F2 is positive so it will be located to the right of the lens.
Step 2: Find q
1/q=( 1/0.05 ) + ( 1/(-0.1))=20 + (-10)=10
1/q=10
q= 1/10
q=0.1M=100mm
Note that we used a negative object distance for p, because p is to the left (in front) of the lens. Your image distance is positive so the image forms to the right (behind) of the lens.
Step 3: Find M
M= 100mm/(-100mm)=(-1mm)
Step 4: Find I
I=(-1mm)×10mm=(-10mm)
Now that we know image distance, primary focal point, secondary focal point, linear magnification, and image height, we can draw our horizontal line (Optical Axis). Refer to rule number one. For example your object distance is -100mm f 1 is -50mm, draw a line that is -100mm long. Mark your starting point (Lens) and your ending point (p).

Using the starting point that you marked above, do the same thing for your image distance. Refer to rule number two. For example your image distance is 100mm and f 2 is 50mm, draw a line that is 100mm long. Since you have already marked your starting point (Lens) mark your ending point (q)

What we need to do next is draw our lens and our object. From where you marked p, draw a vertical line that is 10mm long(Our object height). Where you marked your lens draw a vertical line that is taller than your object height and goes equally as long below the axis.

Mark on your horizontal line f 1 and f 2 .

We are going to trace three rays through the lens to find out how the image was formed.
Ray 1: Draw a line from the top of the object to the lens. This line will be parallel to the optical axis. Now draw a line from where the ray intercepts the lens to f 2 , making sure it goes past q.

Ray 2: Draw a line from the top of the object through f 1 to the lens. Now draw a line, that is parallel to the optical axis, from where the ray intercepts the lens past q.

Ray 3: Draw a line from the top of the object through the optical center past q.

Notice that where all three of the rays meet is where the image is located and formed. If you were doing this to scale the image distance would equal 100mm. Linear magnification is equal to one so the image is neither magnified nor minified. Image height is negative so your image is inverted. The image is to the right of the lens so it is real.
Tracing a Minus Lens
Rules for Minus Lenses
- If your object distance is greater than f 2 (neglecting signs) then your horizontal line(optical axis), from lens to object distance, will be as long as your object distance.
- If your image distance is greater than f 1 then then your horizontal line(optical axis), from lens to image distance, will be as long as your image distance.
Example: A 15mm tall object is placed 100mm in front of a -15.00D lens. What is the image distance and image height? Is the image real or virtual? Is the image erect or virtual?
Step 1: Find f 1 and f 2
f 1=−( 1/-15 )=0.06667M=66.67mm
f 2= 1−15=−0.06667M=−66.67mm
Step 2: Find q
1/q= (1/(-0.06667)) + ( 1/(-0.1))
1/q=(-15) + (-10)
q= 1/−25=-0.04M=-40mm
Now that we know image distance, primary focal point, secondary focal point, we can draw our Optical Axis. Draw your optical axis, marking p , q , f 1 , f 2 , and your lens. Also draw your object height and your lens.

Note that image distance is negative so it is also located to the left of the lens, therefore your line to the right of the lens need only be as long as f 1 .
Ray 1: Draw a line from the top of your object that remains parallel to the optical axis and intercepts with the lens. From the point where Ray 1 intercepts with the lens find where you marked f 2 and draw a dashed line from those two points and a solid line after passing the lens to the right.

Ray 2: Draw a line from the top of your object to f 1 , making the line solid from the top of the object to the lens and dashed from the lens to f 1 .

From where the line intercepts the lens, draw a dashed line that is parallel to the optical axis.

Ray 3: Draw a solid line from the top of your object through your optical center and past f 1 .

Notice where all of the lines come together is where the image is formed. The image is virtual because it is formed to the left of the lens. The image is erect because it is formed above the axis. The image is also smaller than the object so it is minified.
I hope this article helped you gain a better understanding of ray tracing thin lenses. Grab some graph paper and do some of your own, it will help you gain a better understanding of lenses and how they work.
**Keating: Geometric, Physical, and Visual Optics, 2nd ed., Butterworth-Heinemann