-
Notifications
You must be signed in to change notification settings - Fork 611
How to Check if Rectangles are Disjoint
Algebraic functions of rectangles and points can be used to check inclusion and intersection of such objects. Questions like "Are rectangles R1 and R2 disjoint?" or "Is point P outside or inside rectangle R?" can easily be answered.
-
r1.intersects(r2): This is
True
if rectangler2
is contained in rectangler1
. Both may be of different rectangle types (IRect
orRect
). For rectangles, points and matrices, thelist()
andtuple()
functions will return sequences of their coordinates. This is used in this method - it simply returnstuple(r1 & r2) != (0, 0, 0, 0)
. -
r1.contains(x): This is
True
if the rectangle or pointx
is contained in rectangler1
. This is equivalent to the expressionx in r1
.
HOWTO Button annots with JavaScript
HOWTO work with PDF embedded files
HOWTO extract text from inside rectangles
HOWTO extract text in natural reading order
HOWTO create or extract graphics
HOWTO create your own PDF Drawing
Rectangle inclusion & intersection
Metadata & bookmark maintenance