Line intersects with Python

I am writing a Python code that will take two given lines and give me the point of intersection. The input is the endpoints (xi, yi, xi, xj). I got the code to work for the case where the two lines intersect. The problem happens when the lines are parallel and the code gives me an error. Does someone have a suggestion of how I can send out a message that the lines do not intersect and not an error? Thanks in advace.
line intersects python.dyn (2.6 KB)

I think you can introduce an IF statement to test the equality of the absolute of the vectors from the points that define the lines.

1 Like