I was wondering if someone has seen or has code or know's how to go about coding something like this. I essentially want the apple script to run numbers through the following equations.

I want it to come up and ask for the width resolution in pixels, the height resolution in pixels, and diagonal size in inches and then take those numbers and to calculate the diagonal resolution in pixel and then from there calculate the PPI.