It is known that the intersection points between a line and a polyline can be found using Polyxpoly command in MATLAB.
However, the examples given here involve the polylines that are composed of points, but not real lines. Here, a polyline object is created with the interpolation of space between the points.
What I want to do is to obtain the intersection points between the polyline and line that are defined by line equations, but not from a point to another. 
I want to obtain the coordinates of the intersection points in MATLAB (Denoted with blue circles).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With