Algorithm for check how much two rectangles intersect in the X axis

Viewed 42

I need an algorithm to calculate how much two 2D rectangles intersect if their Y positions are the same. I'm comparing several rectangles that might all intersect, and I'd like to pick the one that intersects the most, any help is appreciated

enter image description here

0 Answers
Related