title: Rectangle intersection shared edge
body: <p>I'm trying to determine whether two rectangles border each other. If they share an edge or part of an edge, then I want to include them, if they only share a vertice then I don't. </p>
  
  <p>I've tried using android android.graphics.Rect, I was hoping that the intersect method would return true giving me a rectangle, with 0 width but the points of the intersecting edge. I'm using andEngine and also tried the collideswith method of org.andengine.entity.primitive.Rectangle however that returns true, even if the rectangle only share one corner vertice. </p>
  
  <p>Is there a nice way of doing this? The only other way I can think of is to try and create a collection of all the edges then see if they're equal or are in someway partly equal.  </p>
  
  <p>Here's an image to demonstrate what I want. If I click on rect 1 then I want to return rects 2,3 and 4, but not 5. </p>
  
  
  
  <p>"Map":</p>
  
  <p><a href="https://i.stack.imgur.com/HwoUI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HwoUI.png" alt=""></a></p>