Images formed by a thin lens or a spherical mirror are characterized by the equation:

         1/do + 1/di = 1/f      

using the following sign conventions:
Note: For an object at infinity (a very large distance away), the term 1/do is effectively zero, so in this case the above equation reduces to
           di = f
In the symmetrical situation where the rays are parallel when they leave an optic system,  the image distance is infinite, the term 1/di is effectively zero,  so the equation reduces to
            do = f