By Cartesian sign convention, the direction of the rays incident on the lens is taken positive, and a direction opposite to that is taken as negative.The direction of the incident parallel rays and refracted rays in case of the convex lens is the same. If the image and object are on the same side of the lens, the image distance is negative and the image is virtual. A converging lens always has a positive f, and a diverging lens has a negative f.