Geometric optics treats light as rays that travel in straight lines until they meet a reflecting or refracting surface.
For mirrors, the most important local rule is the law of reflection: the angle of incidence equals the angle of reflection.
If a ray meets the mirror normal at an angle \(\theta_i\), then the reflected ray leaves at the same angle \(\theta_r\), so
\[
\theta_i = \theta_r.
\]
This rule is local, meaning it applies at the exact point where the ray touches the surface. In a curved mirror,
the normal direction changes from point to point, so the reflected direction changes as well. That is why curved mirrors can make light rays converge or diverge.
A concave mirror curves inward toward the incoming light and can form real images in front of the mirror.
A convex mirror bulges outward and always produces a virtual image behind the mirror for a real object placed in front of it.
For spherical or paraxial mirror analysis, image formation is summarized by the mirror equation
\[
\frac{1}{f} = \frac{1}{d_o} + \frac{1}{d_i}.
\]
Here \(f\) is the focal length, \(d_o\) is the object distance, and \(d_i\) is the image distance.
This calculator uses the standard sign convention common in introductory physics:
concave mirrors have positive focal length, convex mirrors have negative focal length,
real objects in front of the mirror have positive object distance, and real images in front of the mirror have positive image distance.
With this convention, a negative image distance indicates that the reflected rays do not actually meet in front of the mirror;
instead, their backward extensions meet behind the mirror, so the image is virtual.
The size and orientation of the image are described by the magnification
\[
m = -\frac{d_i}{d_o},
\]
together with
\[
h_i = m\,h_o.
\]
If \(m\) is negative, the image is inverted. If \(m\) is positive, the image is upright.
A magnitude \(|m|>1\) means the image is larger than the object, while \(|m|<1\) means the image is reduced.
For example, a concave mirror with \(f=20\ \text{cm}\) and \(d_o=30\ \text{cm}\) gives
\[
\begin{aligned}
\frac{1}{d_i} &= \frac{1}{f} - \frac{1}{d_o} \\
&= \frac{1}{20} - \frac{1}{30} \\
&= \frac{1}{60},
\end{aligned}
\]
so \(d_i = 60\ \text{cm}\). Then
\[
\begin{aligned}
m &= -\frac{d_i}{d_o} \\
&= -\frac{60}{30} \\
&= -2.
\end{aligned}
\]
That tells us the image is real, inverted, and twice as tall as the object.
The animated diagram in this calculator uses two classic principal rays from the top of the object.
The first ray travels parallel to the optical axis until it touches the mirror. In the principal-ray approximation,
a concave mirror sends that ray through the focus, while a convex mirror reflects it so that its backward extension passes through the focus.
The second ray goes from the top of the object to the mirror vertex and reflects with equal angle there. Because the mirror normal at the vertex lies on the optical axis,
that second construction cleanly shows the law of reflection. Where the reflected rays meet, or where their dashed backward extensions meet,
the top of the image is located.
In real optical systems, large-angle rays can show spherical aberration, and exact image formation depends on the full shape of the mirror.
For that reason, introductory ray diagrams are understood as paraxial sketches: they are designed to communicate the main geometry very clearly.
This calculator keeps that educational focus. The formulas provide the quantitative image distance and magnification,
while the animation shows how those results connect to the physical path of reflected light. That combination is useful for homework checks,
for understanding why dentist mirrors and makeup mirrors enlarge nearby objects, and for seeing why security mirrors are usually convex:
convex mirrors keep images upright and smaller, which increases the field of view.