Find area of region where k rectangles intersect?

Правка en2, от DollarAkshay, 2019-07-26 02:04:06

Given a list rectangles [R1, R2, R3] defined by their lower left and upper right [(x1, y1), (x2, y2)] coordinates, and a value k.

Is there an optimal way to find area where k rectangles overlap?

For example:

R1: [(1, 1), (5, 5)]
R2: [(4, 4), (7, 6)]
R3: [(3, 3), (8, 7)]

rectangles = [R1, R2, R3]
k = 2

The area which is overlapped by two rectangles is 8.

Source : https://stackoverflow.com/questions/57192928/given-n-rectangles-coordinates-find-area-of-region-where-k-rectangles-intersect/

Grid Image

Теги #grid, #geometry, #help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский DollarAkshay 2019-07-26 02:04:06 0 (published)
en1 Английский DollarAkshay 2019-07-26 02:03:20 644 Initial revision (saved to drafts)