THE MATHEMATICS OF LENSES
In junior high school science classes students are usually shown how to a draw ray diagram for a simple convex lens. Something like
this:
(Figure 1)
This is a simple converging lens or "magnifying glass".
For the purposes of discussion at this level, the lens is assumed to be located at a line perpendicular to a principal axis. Light rays entering the lens parallel to the principal axis all converge on the focal point and the distance from the principal point to the focal point is called the focal length for that particular lens.
Consider now the light coming from a distant star. The star is so far away that the light rays coming from it are, to all intents and purposes, parallel. Therefore the image of a distant star is a lit (as in illuminated) point at a distance FL from the lens.
This can be demonstrated by placing a piece of paper under a magnifying glass pointed at the sun. The image of the sun can be seen at the focal point. In this case the image is noticeably a very small disc as opposed to a point.
We now look at a ray diagram that explains how an image of a closer object is formed:

(Figure 2)
The arrow on the left represents a brightly lit object… perhaps a candle or light bulb. Consider the point P at the top of the object… light rays radiate from it out in all directions. One of these light rays is parallel to the principal axis. It is bent in such a way that it passes through the focal point. Another of these rays passes through the principal point. It is assumed not to be bent at all. The two rays cross each other at P'
We are now told that the lens behaves in such a way that all light rays leaving P that hit the lens also pass through P':

The net effect is that an inverted real image is formed at some place beyond F.
(Figure 3)
There is a bit more to this, of course. What we have presented is a brief review of some background material pre-requisite to the discussion that follows.
This elementary geometric treatment of a simple lens is only a rough approximation of what happens in the real world. Real light rays passing through real lenses do not behave quite this way.
We continue our review of elementary optics with a topic which is usually part of a high school physics course. Consider a air-glass interface:
(Figure 5)
When a light ray enters a piece of glass at and angle i (incidence angle) to the normal (perpendicular to the surface at the entry point, it is refracted (bent), and continues in direction indicated by r (the refracted angle). According to Schnell's Law:
sin(i)/sin(r)= RI
… where RI is the refractive index for the glass. Incidentally, the refractive index differs for different colours.
We now re-examine a more realistic ray diagram for a simple convex lens.

Incoming Ray strikes first surface of lens
(Figure 5)
Inexpensive lens surfaces are (well they used to be - now this is not longer so) always parts of spheres. This is because of manufacturing considerations. In diagrams, lens surfaces are represented by arcs. The first surface is an arc of radius rc1 centred on C1. The second surface has a radius of curvature of RC2 and is centred on C2.
The thickness of the lens in the middle is d.
There is an incoming ray that passes through the perpendicular to the principal axis at a distance OFFSET from P1. This ray makes and angle of INC (incoming ray) with the principal axis. For the purposes of this discussion, the direction of a ray will be the clockwise measure from "east".
The ray strikes the first surface of the lens at S1 and is refracted. The refractive index of the glass is RI
The next section deals with how to calculate the focal length of a simple double convex lens. This is done by:
1. Finding the coordinates of point where an incoming ray strikes the first lens surface, and then
2. Finding the direction of the ray refracted at the first surface, and then,
3. Finding the coordinates of the point where the refracted ray strikes the second surface, and then
4. Finding the direction of the ray refracted at the second surface, and then,

5. Finding the distance from P where this second refracted rays crosses the principal axis.
(Figure 6)
A ray (blue)enters the first surface of a convex lens (red) at S1. The offset is the distance from P, the centre of the lens, perpendicular to the principal axis. C1 is the centre of curvature of the first surface. C1S1 is the radius of curvature to S1. It is perpendicular to the tangent of the curve at S1. i1 is the clockwise direction from "east" of the incoming ray, and is also the "angle of incidence". r1 is the angle of refraction.
For the purposes of the following calculations we assign values as follows:
--Initialize:
rc1 = 7; rc2 = 9 -- radii of curvature
offset = 4
dRay1 = 15 -- angle of entering ray
d = 3 -- thickness of lens
ri = 1.5 -- refractive index
The following is a transcript of a MathPad page. The calculated value for each line is shown in red.
-- Calculations for surface 1
Q1y = offset ; Q1y:4.000000
R1Q1S1 = dRay1
C1Q1 = sqrt(rc1^2+Q1y^2) ; C1Q1 :8.062258
C1Q1P = atan(rc1/Q1y) ; C1Q1P:60.255119
PC1Q1 = 90 - C1Q1P ; PC1Q1:29.744881
C1Q1S1 = 90 - (R1Q1S1 + C1Q1P) ; C1Q1S1:14.744881
R1S1Q1 = asin(C1Q1 * sin(C1Q1S1) / rc1) ; R1S1Q1:17.045951
C1S1Q1 = 180 - R1S1Q1 ; C1S1Q1:162.954049
Q1C1R1 = 180 - (C1S1Q1 + C1Q1S1) ; Q1C1R1:2.301070
PC1S1 = PC1Q1 + Q1C1R1 ; PC1S1:32.045951
-- Coordinates of ray antry at surface 1
S1y = rc1 * sin(PC1S1) ; S1y:3.714195
S1x = rc1 - rc1 * cos(PC1S1) ; S1x:1.066640
-- Angles of incidence and refraction at surface 1

i1 = R1S1Q1 ; i1:17.045951
r1 = asin(sin(i1)/ri) ; r1:11.269594
Continuing with the calculations for the second surface, we get:
-- Calculations at surface 2
C1x = rc1 ; C1x:7.000000
C2x = d - rc2 ; C2x:-6.000000
C2S1 = sqrt((S1x - C2x)^2 + S1y^2) ; C2S1:7.983273
C2S2 = rc2 ; C2S2:9.000000
C1C2 = C1x - C2x ; C1C2:13.000000
C1S1 = rc1 ; C1S1:7.000000
C1C2S1 = asin(S1y/C2S1) ; C1C2S1:27.726216
C1S1C2 = 180-asin(C1C2 * sin(C1C2S1) / C1S1) ; C1S1C2:120.227833
C2S1S2 = C1S1C2 + r1 ; C2S1S2:131.497427
C2S2S1 = asin(C2S1 * sin(C2S1S2) / C2S2) ; C2S2S1:41.634229
S1C2S2 = 180 - (C2S2S1 + C2S1S2) ; S1C2S2:6.868345
C1C2S2 = C1C2S1 - S1C2S2 ; C1C2S2:20.857871
-- Coordinates of ray antry at surface 2
S2x = C2S2 * cos(C1C2S2) + C2x ; S2x:2.410199
S2y = C2S2 * sin(C1C2S2) ; S2y:3.204459
-- Angles of incidence and refraction at surface 2
i2 = C1C2S2 ; i2:20.857871
r2 = asin(sin(i2)*ri) ; r2:32.281302
-- Direction of exiting ray
dRay3 = r2 - C1C2S2 ; dRay3:11.423432
-- Distance from P where exiting ray crosses principal axis (F?)
Fx = S2x + S2y/tan(dRay3) ; Fx:18.269068
It is appreciated That these calculations involve some fairly complicated trigonometry and are confusing!
In this instance we see that the incoming ray will cross the principal axis at 18.3 units from P.
Suppose now that the incoming ray is parallel to the principal axis. In other words, assume that i1 = 0; then the exiting ray should intercept the principal axis at distance F (focal length) from P.
Using the above MathPad document for:
radius of curvature of first surface = 13
radius of curvature of second surface = 10
incoming ray parallel to principal axis,
lens thickness = 5
refractive index = 1.5
… we get these results:
|
OFFSET |
05 |
1.0 |
1.5 |
2.0 |
2.5 |
3.0 |
3.5 |
4.0 |
4.5 |
5.0 |
5.5 |
6.0 |
6.5 |
|
F |
24.96 |
24.83 |
24.61 |
24.30 |
23.88 |
23.35 |
22.69 |
21.88 |
20.88 |
19.65 |
18.08 |
15.99 |
12.83 |

This shows that the focal length of this lens is approximately 25 units, but this is only valid for very small offsets. We say that single lenses suffer from spherical aberration.
It is also only true for the one colour of light for which the index of refraction is 1.5. Yes, the refractive index of a piece of glass is different for different colours and this leads to chromatic aberration.
The problem of spherical and chromatic aberration are addressed by compoune lenses. Manty of these designs are patented. In the next section we attempt to draw ray diangrams for a well know compound lens design.