where so is the object distance, si is the image distance, and f is the focal length. Negative image distances correspond to virtual images, and positive image distances correspond to real images.
The accuracy of this equation is subject to the validity of the paraxial approximation which requires that the focal length be much greater that the diameter of the optic.
Thin lenses have focal lengths given by

Focal lengths of converging optics are positive, and focal lengths of diverging optics are negative.
Note: focal lengths for all problems in this section are given as positive quantities. When working with the lensmaker's formula, it is your responsibility to assign negative values to focal lengths of diverging optics.
where h denotes the image and object heights, and s denotes the image and object distances. Negative magnifications correspond to inverted images and positive magnifications correspond to upright images.
Single optics always give inverted real images and upright virtual images.