Image

Image distanceis denoted by

However, $S’$, the image distance, is negative because it is on the virtual side of the lens. This is just a convention adopted by most textbooks so that the calculations work correctly. See this page for the rules, or this page for some reasoning behind the rules.

Image

$S$ is not negative. The picture clearly states $00$ and $f>S$. This is because the object is in front, or on the ‘virtual’ side of the lens.

Image distance vs object distancegraph

First the image distance and object distance are all coordinates here so it makes sense why they could be positive or negative.Since the figure is taken so that light travels from the left to right so you can take the right side of the lens as positive x direction having positive coordinates while that of the left of the lens as negative coordinates.Just follow the sign conventions and you will find it easy to determine the signs in both lens and mirror equations.

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.