|
Dear all,
I am having problems with the intersections function published by Douglas Schwarz. It may be viewed here: http://www.mathworks.com/matlabcentral/fileexchange/11837-fast-and-robust-curve-intersections
I have 2 problems.
Problem 1: The function works correctly between any two curves. Furthermore, it works correctly for x-amounts of curves if coded in a loop. My problem is that I'd like to perform the operation for any amounts of curves without a loop but so far have not been able to.
The syntax is [xo,yo] = intersections(x1,y1,x2,y2)
Where xo and yo represent the coordinates of the intersection points and (x1,y1) & (x2,y2) represent the coordinates of the curves
I have around 600 lines described by (x1,y1) and one complex curve (x2,y2). As stated, I would like to find all the intersection points between all 600 versions of (x1,y1) with (x2,y2) without using a loop.
Problem 2: The curve described b (x2,y2) is quite complex. Therefore, the amount of intersection points between each version of (x1,y1) and (x2,y2) varies from 2 to around 8 (but I cannot be sure). Is there a way using no loops to store all intersection points even tho they vary for each version of (x1,y1)?
Problem 3 (and the last): Having calculated all intersection points between all curves, I need to compare the distances of each intersection points with a set point and retain only the two intersection points which lie closest to this set point. How many I do this given the fact that I do not know how many intersection points exist for each pair of curves?
Thank you so much for anyone willing to help me,
I will be forever in the debt to whoever can solve (or at least help) my problems.
F
|