I've found many algorithms online for finding the intersection point of two line segments, but they completely fail when the line segments in question are collinear. For instance, if I have one line segment from $(-1, 2)$ to $(1, 2)$, and another from $(1, 2)$ to $(2, 2)$, the algorithm should say they intersect at $(1, 2)$, but all the ones I've tried say they don't intersect at all. (This seems to be due to them relying on division, and when they're collinear like this, it's division by $0$)
Is there a formula/algorithm to find the intersection point of two line segments that accounts for collinearity?