Clear Filters
Clear Filters

How to find intersection points of two discrete curves?

9 views (last 30 days)
I have two curves, one is a circle with given centre and radius, the other is [x1 x2 x3...xN; y1,y2,y3,,,yN]. The second one is a curve, and the point(s) of intersection may not be one of those points in my dataset. I want to calculate the precise point of intersection between the circle and the "interpolated" curve?
Note.: 1.) I don't want to use linspace(x1,xN,<large number>) and then check if it lies on the circle. This won't give the precise result as it may again lie between one of those discrete points. 2.) I have tried using InterX (https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function) but it also fails in many situations.

Accepted Answer

John D'Errico
John D'Errico on 25 Mar 2018
Edited: John D'Errico on 25 Mar 2018
I would suggest instead Doug Schwarz's utility, intersections. It was written to be as robust as possible, and Doug is a programmer for whom I have a great deal of respect. He also spent a fair amount of effort to make it robust as I recall, and he has carefully maintained it over the years.
https://www.mathworks.com/matlabcentral/fileexchange/11837-fast-and-robust-curve-intersections
Of course, you should remember that since any such tool will only do linear interpolation, the intersection with a nonlinear curve (a circle) will be only as good as the interpolation.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!