If we wanted to calculate the numerical position of an image or the focal length of a spherical mirror, we would use the mirror equation. It may be stated in one of these two alternative forms: In this equation each variable has a special meaning.

d_{o} represents the distance from the vertex of the mirror to the position of the object as measured along the axis

d_{i} represents the distance from the vertex of the mirror to the position of the image as measured along the axis

f represents the focal length of the mirror. Remember that
2f = CV.
These sign conventions are summarized in the following table.
d_{o} 

positive


when the object is "in front of the mirror"

d_{i} 

positive


real images (inverted  "in front of the mirror")

d_{i} 

negative


virtual images (upright  "behind the mirror")

f


positive


converging (concave) mirrors

f


negative


diverging (convex) mirrors

In this equation, d_{o}, d_{i}, and f must be measured in the same unit  usually all three are either expressed in centimeters or in meters.
The formula used to calculate the magnification of an image is: where I and O represent the sizes of the image and object respectively.
As opposed to merely calculating the magnification of a mirror system, this equation is often used to compare the sizes of objects and images with their locations. For example, when a problem states that a real image is twice as large as an object this requires that you use the relationship
d_{i} = 2d_{o} in the mirror equation. A virtual image twice as large as the object would need you to use the value
d_{i} = 2d_{o}.
Let's work a few examples to show how these equations complement the ray diagrams that we have already learned how to construct. 