Geometry is about boundary rules
Build three tools:
- Signed orientation plus bounds for closed segments.
- An active count with an explicit tie convention.
- Closest pair recursion returning both distance and y order.
Predict endpoint contact, duplicates, and extreme coordinates before ordinary cases.
1 / 8