Return Coordinates of Rectangle

I believe that we can find the coordinates of two overlapping rectangle in the following way:
Rectangle overlapArrea(Rectangle rc1, Rectangle rc2) { Rectangle res = new Rectangle(); res.lpt = new Point(Math.max(rc1.lpt.x, rc2.lpt.x), Math.max(rc1.lpt.y, rc2.lpt.y)); res.bpt = new Point(Math.min(rc1.bpt.x, rc2.bpt.x), Math.min(rc1.bpt.y, rc2.bpt.y)); return res; }