We're using the Sharp 2Y0A021YK IR sensors (10cm-80cm), but unfortunately it's not a linear output. The datasheet has a graph, but it's print-only, they don't give you either values or a formula.
So, I plotted out about 50 points, put them into an excel spreadsheet, built a XY chart out of them, then used "Add Trendline" to get a line that fit the graph, and then got the formula from that. So now we have the function that converts the voltage the sensor puts out into the actual distance (sure would be nice if this were on the datasheet)
dist_mm = 1085534.81 * (float)pow((float)voltage_mv, -1.2);
Where voltage is in in milivolts, and the returned distance is in milimeters.
Really sharp, put this on your datasheet!
Kallahar