Rectangle intersection

后端 未结 1 452
北荒
北荒 2021-01-27 09:52

Is there any known approach to compute the intersection rectangle between two rectangles? I mean if the rectangle A is defined by (x1,y2, x2,y2) and B by (x3,y3, x4,y4), how do

相关标签:
1条回答
  • 2021-01-27 10:18

    The general problem of intersecting polygons is explained in detail in here: http://davis.wpi.edu/~matt/courses/clipping . Incidentally, one of the best libraries for the task, with bindings for several programming languages, is GPC - the General Polygon Clipper library: http://www.cs.man.ac.uk/~toby/alan/software

    0 讨论(0)
提交回复
热议问题