Dear!
if u have the trick as to how to calculate all these stuffs,
then simply create an ActiveX DLL,use private functions
to calculate all the necessary information.
use public functions as class methods.
and expose the results as the properties of the class.

use the asp Server.CreateObject("") to create an instance of the component. and call the appropriate method and get the result from the properties(calculated internally).
It will solve ur problem.