find the point of intersection of one curve with itselfs

1 回表示 (過去 30 日間)
Niklas Deines
Niklas Deines 2022 年 6 月 16 日
編集済み: Kevin Holly 2022 年 6 月 16 日
hey Everyone,
i have:
x = [2 0 0 2 2 -1]';
y = [4 4 0 0 2 2]';
and i have to to find the point, where the function cuts itselfs. I know it should work with cscvn and anonymous function but i dont know how exactly. A picture of the function is attached

採用された回答

Kevin Holly
Kevin Holly 2022 年 6 月 16 日
編集済み: Kevin Holly 2022 年 6 月 16 日
x = [2 0 0 2 2 -1];
y = [4 4 0 0 2 2];
points = [x;y];
h=fnplt(cscvn(points));
plot(h(1,:),h(2,:));hold on,
plot(points(1,:),points(2,:),'o'), hold off
I divided the line into two separate lines and used polyxpoly from the mapping toolbox:
[yi,xi] = polyxpoly(h(2,1:round(end/2)-1),h(1,1:round(end/2)-1),h(2,round(end/2):end),h(1,round(end/2):end))
yi = 2.1028
xi = -0.5395
hold on
plot(xi,yi,'g*')
xi
xi = -0.5395
yi
yi = 2.1028

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLeast Squares についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by