see

http://www.stanford.edu/%7Ecpatton/pinhole.html

for general information, and look for the calculator.