//Example 22_6 clc(); clear; //To draw a ray diagram to locate the image printf("From the diagram we notice that eyes will assume that the three rays come from image position indicated and as we see the image is virtual, erect and enlarged") d1=10 //units in cm d2=5 //units in cm i=(d1*d2)/(d2-d1) //Units in cm printf("\nThe image is located at i=%.2f cm",i)