Simple geometric algorithms.