Mirrors and lenses normally have the circular symmetry. The axis of this symmetry is called the principal axis. The ray, following the path of the principal axis passes the lens without altering its path. For mirror, such ray is directly reflected back. As both mirrors and lenses are curved surfaces, they have the centre of the curvature located on the principal axis. The point between centre of the curvature and the mirror (or lens) is called the focal point.
Ray diagram[1][2][3] is built following the two simple rules[4]:
Converging lens[5] bends rays toward they optic axis and is able to focus parallel rays to the single point where the screen (as in cinema) or photo-sensing matrix (as in camera) can be placed to capture the image. Such image is called the real image.
Diverging lense cannot focus rays this way as it bends rays away from they optic axis. However bending rays away from the optic axis means that the continuations of the ray met on the other side of the lens, focusing so called virtual image[6]. The virtual image cannot projected into screen but it can be seen by human eye, photo camera or other device with its own optical system that could focus the rays. It is located at the same side of the lens as the object itself (this is where the ray continuations met) and has the original orientation (not upside down). It can be seen by eye or camera if looking from the opposite side through the lens. Corrective lenses that many people wear to compensate myopia are concave lenses, so they present virtual images against the myopic eye. Such eye can see them even better than real ones.
Converging mirror has a reflecting surface that bulges inward, away from the incident light. It focuses rays in a more complex way, depending on the distance between the object and mirror[7].
Convex mirror reflects parallel rays so that they all meet at the focal point.
Diverging mirror (also called fisheye mirror) always forms virtual image, as both its focal point and centre of the curvature lie behind the mirror, in the "imaginary space". The image is always smaller that the original one and keeps the same orientation. Convex mirror gives the wider view angle than the flat mirror, and is often used where this wider angle is required. When important (as in the car mirrors) it contains the safety label that reflected objects look more distant than they are. Same as for the convex lens, reflected virtual images can be easily seen by human eye.
Due ability to focus parallel rays convex lenses and mirrors are also called converging lenses and mirrors, and they opposite counterparts are called diverging lenses and mirrors.
The lens that is thin enough to ignore its own volume can be described by equation
where O is the distance between object and lens, I is the distance between image and lens, and F is the focus length of lens. The applet above contains analytic solutions of this equation and would compute the missing value when others two are given. Negative distance to image means virtual image, and negative focus length means concave (diverging) lens. The distance can be in meters, centimeters or any other units, even fictional ones, as long as the same units are used to express all three values involved.
Ray diagram of the Prism.
Graphical Ray diagram applet by Carlo Barraco, Todd Fuller