For a comprehensive explanation of the principles behind this calculation, please see Will Ferch's Rennlist Tech Article on the subject
Thanks to Will Ferch for doing the actual math that made this possible.
Technical questions about this web page and/or script can be directed to Thom Fitzpatrick