

The focal length of a lens in air can be calculated from the lensmakers equation:
1/f = (n-1) [ (1/R1) - (1/R2) + ((n-1)d)/(n*R1*R2)} ],
where
f is the focal length of the lens,
n is the refractive index of the lens material,
R1 is the radius of curvature of the lens surface closest to the light source,
R2 is the radius of curvature of the lens surface farthest from the light source, and
d is the thickness of the lens (the distance along the lens axis between the two surface vertices).
The signs of the lens radii of curvature indicate whether the corresponding surfaces are convex or concave. The sign convention used to represent this varies, but in this article if R1 is positive the first surface is convex, and if R1 is negative the surface is concave. The signs are reversed for the back surface of the lens: if R2 is positive the surface is concave, and if R2 is negative the surface is convex. If either radius is infinite, the corresponding surface is flat. With this convention the signs are determined by the shapes of the lens surfaces, and are independent of the direction in which light travels through the lens.
Thin lens equation
If d is small compared to R1 and R2, then the thin lens approximation can be made. For a lens in air, f is then given by
1/f = (n-1) ( (1/R1) - (1/R2) )
The focal length f is positive for converging lenses, and negative for diverging lenses. The value 1/f is known as the optical power of the lens, measured in dioptres, which are units equal to inverse meters (m−1).
Lenses have the same focal length when light travels from the back to the front as when light goes from the front to the back, although other properties of the lens, such as the aberrations are not necessarily the same in both directions.
