Shamos Hoey Line intersection algorithm