Light Rays through Lenses

Click here for the Java source code
Click here for the Java class file

How to Use the Program

There are three things you can do to this program:

The Science Behind the Program

We all know that light travels in straight lines. Most of us know that light changes direction slightly when it enters or leaves one transparent medium (such as air) and enters another one (such as glass or water) - this effect is called refraction. Any equipment that includes lenses, such as telescopes, microscopes and magnifying glasses, uses this effect to enlarge images.

There are two types of lens - convex lenses bend outwards, and concave lenses bend inwards (i.e. contain a "dip" rather than a bulge). Each bends light according to certain fixed rules, and each can produce a sharp image if correctly focussed. The surfaces of each lens form parts of spherical surfaces: if you continued those surfaces all the way round, they would form giant spheres (one for each surface). The central points of those spheres are called the "centres of curvature". The point that is half way between the exact centre of the lens (the "optic centre") and either of the two centres of curvature is called the "focal point", and the distance between the optic centre and the focal point is the "focal length".

When we look through any lens, we see rays of light that have emerged from an object standing on the other side of the lens. These rays appear to come from a point somewhere in space (not necessarily the same position as the object), and the object appears to be at that point - this is called the image. Because the rays of light obey fixed rules, we can predict where the image would be for any object position.

Diagrams used to predict the image position usually represent the object as an arrow that sits on the main axis of the lens. The base of the image (the opposite end to the arrow) will also sit on the axis of the lens - we are interested in the position of the arrow end of the image. Here are the rules governing the light rays:

Light rays travelling through the optical centre of the lens does not change direction. This applies whether the lens is convex or concave.

Light rays hitting a convex lens parallel to the axis converge (move towards the centre of the lens) and pass through the focal point on the other side to the object. If the lens is concave, the ray diverges (move away from the centre), as if it emerged from the focal point on the same side as the object.

There is one more rule that applies to convex lenses only. Any ray that passes through the focal point on the same side of the lens as the object will emerge from the lens parallel to the principle axis.

If the image is the same way up as the object, then we say it is erect. If it is upside-down relative to the object, we say it is inverted. If the image is larger than the object, then it is magnified, if smaller, then it is diminished. If the light rays that form the image actually do cross at a point, then the image can be thrown on to a screen (i.e. if you put a white piece of paper at that point, the image would appear on it). In this case, we say that the image is real. If the light rays from the image only appear to come from a point, i.e. we had to draw dotted lines back from the light rays to show a position where they appear to come from) then the image is virtual - you cannot throw it on to a screen at that point.