Pls how do I setup a from and to address and allow my UPS integrated solution calculate shipping based off the two addresses? [closed]

So, I am setting up a website to handle shipping services similar to DHL and UPS, but I am also using UPS services to handle the shipping cost through their API to my specific users, and I want to be able to calculate shipping by allowing users to enter a from and to shipping address, and calculate the shipping based on the distance. Any help would be much appreciated.