The Amazon search is as good a place as any to look for books. This is the one we read at Uni.
For what you want to do, don't code it up... Use GDAL.
Use warp: http://www.gdal.org/gdalwarp.html
Here's a guide: http://gis.stackexchange.com/questions/27297/how-to-georeference-using-gdal-tools
This gets you a georeferenced image. Have a read of more about GDAL, for example this: http://www.gdal.org/gdal_datamodel.html or this: http://www.gdal.org/gdallocationinfo.html
In fact, that last link seems to give you just what you want.