Hi ,
This is something that will require a bit of math, but the formula for what you are attempting to get can be found here:
http://www.3dkingdoms.com/weekly/weekly.php?a=2
Additionally, you can find a wealth of information on mathematical formulas in our math hallway content example: