Reference PDF:

An Optimal Rectangle-Intersection Algorithm

Using Linear Arrays Only – Devai & Neumann

Additionally, I amended to include all *touching *(edge-to-edge, corner-to-corner), with no change in running time.

The code is in git and below:

I‘ve put together the following C++ code to detect rectangle intersections in time ,

Reference PDF:

An Optimal Rectangle-Intersection Algorithm

Using Linear Arrays Only – Devai & Neumann

Additionally, I amended to include all *touching *(edge-to-edge, corner-to-corner), with no change in running time.

The code is in git and below: