This code create 2 random rectangles (1x1 is minimum and 20x20 is the maximum) and check if the rectangles are intersect by using their centers and show the 2D result using matplotlib The rectangle are created with (x,y,width,height) in mind (x and y are the coordinates of the left down corner rectangle).
Note : this is not the best method to do it. Jupyter Notebook was used.