If you create a line segment by choosing two points on your infinite line which are outside the polyline, then you'll have what you need for polyxpoly
. Choose, for example,
x0=min(black_polyline_x) - 100;
x1=max(black_polyline_x) + 100;
Then compute y0 and y1 to be on the line.