Quoted By:
Tbh the only true answer is to extent portal's physics and implement them such that a given outcome happens.
Its already been tried in game and just causes glitches. But a formula could handle some combination between a and b and then just choose which you prefer.