The Thin Lens Equation
The thin lens equation is used to find the position of image or object for lenses that are approximately spherical. It is given by
where f = focal length of the lens. f is negative for diverging lenses (below left) and positive for converging lenses (below right).

Also the image or object distance v or u may be positive or negative respectively depending on whether the image or object is real, in which case we take the positive values or virtual, in which case we take the negative values.
Example:
Converging lens, real object and image, so u, v, f are all positive.
Example:
Diverging lens, real object, virtual image – f is negative, u positive and v negative.
Example:
Converging lens. Real object, virtual image, so f and u are positive, and v is negative.