Lens Ray Tracing in Geogebra

One of my students came to me today to ask about ray tracing in preparation for his SAT II tomorrow in Physics. What happened is a good example of what tends to be my thought process in using technology to do something different.

Step 1 – I looked through some of my old worksheets, which I haven’t used in a while since I haven’t taught physics since 2009. The material I was happy with back then suddenly didn’t work for me. Given the fact he was standing there (and that time was of the essence) I wasn’t about to make a whole new worksheet.

Step 2 – I started drawing things on the board. This started working out fine, but I realized that every drawing I made would have to be erased or redone or saved in some other format. The student, after all, was most interested in learning how to do it and getting some practice. We did a couple sketches for mirrors, but when we got to lenses, I realized there had to be a better way. The sign for me for technology to step in is when I find myself doing the same thing over and over again, so the next step was pretty obvious.

Step 3 – Geogebra to the rescue. This is a particularly sharp student, so I was pretty happy with just talking him through what I was doing and asking him questions as I put together a quick demo of how to do this. He was pretty impressed with how logical the concept of ray tracing was, and had read the basic procedure in the textbook, but actually seeing it happen made a big difference. As he was standing there, his questions pushed me to make the applet (to steal Darren Kuropatwa‘s term) “a little more awesome.”

He asked what happens when the object is inside the focus of the lens. This led to throwing in some simple logic to selectively display the rays to show the location of the image when it is virtual and real. He asked what the difference is for a diverging lens. I told the student that I didn’t know what would happen if I switched the primary and secondary foci in Geogebra, but we talked about why that would relate to a diverging lens. Sure enough, the image appeared virtual and upright in the applet.

Step 4 – I then adjusted it a bit to show a diverging lens when the primary focus was on the left side of the lens, cleaned up some things, added colors, and now I have this cool applet to use when I get to working on lenses in the spring.


I like when I can think on my toes and use a tool like Geogebra to make something that will really make a difference. When I do this activity in the spring, it would be cool to put this side by side with an actual lens and an object and have students compare what is happening in both cases.

Check out the applet here: http://www.geogebra.org/en/upload/files/weinbergmath/Lens_Ray_Tracing.html

You can direct download the Geogebra file from here but be aware that I made the mistake of creating it in the beta version of 4.2. At some point, I’ll do it in the stable version.

You can drag the head of the arrow around, as well as move the primary focus F_p around to change it into a diverging lens. Clearly there are limitations to this – drag the object to the right side of the lens, for example, but I think it’s pretty cool that Geogebra can show something like this after an hour or so of playing around.

Have fun!

Leave a Reply

Your email address will not be published. Required fields are marked *