Skip to content
Advertisement

Tag: line-intersection

Numpy and line intersections

How would I use numpy to calculate the intersection between two line segments? In the code I have segment1 = ((x1,y1),(x2,y2)) and segment2 = ((x1,y1),(x2,y2)). Note segment1 does not equal segment2. So in my code I’ve also been calculating the slope and y-intercept, it would be nice if that could be avoided but I don’t know of a way how.

Advertisement