-
Notifications
You must be signed in to change notification settings - Fork 588
How to Check if Rectangles are Disjoint
Algebraic functions of rectangle and points can be used to check inclusion of such objects. Questions like "Is rectangle R1 contained in rectangle R2?" or "Is point P outside or inside rectangle R?" can easily be answered.
For rectangles, points and matrices, the list()
and tuple()
functions will return sequences of the coordinates. Therefore:
tuple(r1 & r2) == (0, 0, 0, 0)
means that r1 and r2 are disjoint (have nothing in common). Rectangles need not be of same type (IRect
or Rect
). There also is a new method for IRect
/Rect
doing the same thing: r1.intersects(r2)
delivers (the negation of) the bool above.
tuple(r1 | x) == tuple(r1)
means that x is completely contained in r1. x can be any rectangle or point in this case.
There also is a new method for Rect
/IRect
doing the same: r1.contains(x)
delivers the bool of above.
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