detect line intersection