Hello WHO, and welcome.
The alignment is not so much a calculation but rather a procedure. Most of the stuff I have done (short shafting and small propulsion plants 0-5MW) is rather straightforward with either a dial indicator gauge measuring deviation at the face and periphery of the flange you are aligning to. On smaller boats you can get away with just a straight edge and some feeler gauges.
Both method's aim is to make sure the mating surfaces are fully flat or aligned before mating them with bolts. Usually you have to work your way forward from the propeller... ie. tail shaft, intermediate shaft, thrust shaft or gear box, and finally engine.
There is obviously much more trouble shooting to be done on larger shaft and I understand that the strain gauge method is the most reliable in determining problem areas, which manifest them shelve as vibration to us mere mortal.
For details and further considerations on the procedure, I dug into my bible ("Marine Engineering" by SNAME) and scanned some pages for you on Shaft Alignment. You can download it here (http://dieselduck.info/_bigbin/shaft%20alignment.pdf
) for the time being.
Hope that helps,