Line Intersection Algorithm