Notifications
Clear all

[Closed] Determine if a vector intersects an edge segment?

I’m trying to understand how to check if a vector would intersect with an edge segment (with a tolerance), but I’m just not sure how to pull it off. The Line-line intersection is the closest thing I saw in the calculations sticky, but that wont work since it’s for two vectors (lines with no end). Not sure I’m explaining this well, but if so hopefully someone here would be able help?

2 Replies

Do you mean a Ray-line intersection test? Or ray-ray intersection test?

I guess he is about ray segment intersection.
All you need to do is to find if two lines intersect and if they do then you check if sum of distances from segmentPoint1 to intersectionPoint and segmentPoint2 to intersectionPoint is equal to distance from segmentPoint1 to segmentPoint2. Hope it makes sense