I am trying to implement the following. I have two bounds A and B, I want to transform box B so that the intersection between A and B no longer exists. I'm not sure how to calculate the shift, i want to maintain the direction, i.e the red line.
Haven't written much code, pretty stuck with the math.
var a = new Rectangle(40, 40, 20, 20);
var b = new Rectangle(25, 30, 20, 20);