Intersection over Union (IoU) measures how much two shapes overlap, defined as the area of their
intersection divided by the area of their union:
IoU = |A ∩ B| / |A ∪ B| = |A ∩ B| / (|A| + |B| − |A ∩ B|). Drag the purple polygon; the
blue rectangle is fixed but rotatable with its handle.
Move inside purple to translate; drag purple vertices to reshape. Drag the small blue circle above the rectangle to rotate it. Toggle the intersection shading if needed.