Doing line intersection tests