You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jorj X. McKie edited this page Apr 15, 2017
·
7 revisions
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): is True if r1 has a non-empty intersection with rectangle r2.
r1.contains(x): is True if the rectangle or point x is contained in rectangle r1. This is equivalent to the expression x in r1.