Hi,
The x co-ordinates as well as the y co-ordinates of the line and the circle should not be combined as this generates a complicated polygon and a new solution is found other than the expected ones.
As a workaround one can use the polyxpoly function twice to generate two sets of solutions which together will provide the expected solution. [xi,yi]= polyxpoly(All([next_point;current_point],1),...
All([next_point;current_point],2),circle(:,1),circle(:,2));
[xj,yj]=polyxpoly(All([next_point;current_point],1),...
All([next_point;current_point],2),x_line,y_line);
Here [xi,yi] will give us the points of intersection between the line and the circle and [xj,yj] will give us the point of intersection between the two lines.
Hope this helps!
Best Answer