Replicate the distance parameter of a handle adornement

I have been working on a custom handles system recently and I’ve ran into a problem. What is the logic for manually calculating the distance parameter that would normally be returned by a handle adornment?

not sure if replying to my own post bumps this up in the search but, gonna do it anyways.