I’d advise to test those values with those examples you give, because as far as I can see, it covers every case.
For example, it doesn’t matter at all if rA.x is the center, top right, bottom left, nor does it matter if it offsets.
What you want to know is IF they intersect at all, not to determine the coordinates where they intersect.
I know it’s a bit confusing at first, because it can feel a bit counter intuitive, but his formula is basically the very application of the mathematical formulas for that very question, in the cleanest form, both for the reading and for the machine operations.
Again, the best part is that you don’t have to blindly believe, you should be able to try it pretty easily by setting up cases and calling the function on those.
Nope (rA.center is the center, and rA.x is the same as rA.xMin; see the docs), but yeah it doesn’t actually matter. Although it could have been simplified by doing stuff like rA.xMax instead of rA.x+rA.width (same thing).
To the OP - If you never plan to rotate your Rectangles (or if you have some algorithm that will transform the rects to their normal orientation), this algorithm will work.
If you do plan on rotating the rectangles, this algorithm may fail.
You’re probably already aware of this, just giving you a word of caution in case you aren’t. Consider using Colliders or Line equations (not necessarily linecasts/raycasts, but Point/Direction lines) to detect these kind of collisions.