When I want to check intersect between 2 square, I use java.awt.geom.
=============================================
Rectangle2D r1 = new Rectangle2D.Double(x, y, width, height);
Rectangle2D r2 = new Rectangle2D.Double(x, y, width, height);
Rectangle2D diff = r1.createIntersection(r2);
=============================================
But, when between r2 and r1 has no intersect then this class make strange shape.....
I will check why this class out put like as this.
=============================================
Rectangle2D r1 = new Rectangle2D.Double(x, y, width, height);
Rectangle2D r2 = new Rectangle2D.Double(x, y, width, height);
Rectangle2D diff = r1.createIntersection(r2);
=============================================
But, when between r2 and r1 has no intersect then this class make strange shape.....
I will check why this class out put like as this.
Comments
Before writing is not wrong
Rectangle2D r1 = new Rectangle2D.Double(double,double, double, double);
Rectangle2D r2 = new Rectangle2D.Double(double,double, double, double);
Rectangle2D diff = r1.createIntersection(r2);
if(diff.isEmpty() == true)
{}
else
{}