How do you find the points where a line crosses over itself?

8 ビュー (過去 30 日間)
Laura Berkowitz
Laura Berkowitz 2017 年 9 月 26 日
コメント済み: Laura Berkowitz 2017 年 9 月 27 日
I have a set of XY coordinates and I need to identify the number and location of where the line intersects itself. I've plotted an example below.
The following code worked, but I'm concerned the thresholding input to unique tol may cause false positives.
[C,iz,ic]=uniquetol(Z,.03,'ByRows',true);
L=setdiff(Z,C,'rows','stable');
figure;plot(Z(:,1),Z(:,2));hold on; scatter(L(:,1),L(:,2))
For example, below is .03
And this was set at .04
The data were collected at the same frame rate, but the object being tracked exhibited variable velocity. Anyone have any idea how to determine threshold for a specific velocity? Or perhaps another method that is less error prone in general?
Any help/input is much appreciated!

採用された回答

KSSV
KSSV 2017 年 9 月 27 日
load XY.mat ;
x = A(:,1) ; y = A(:,2) ;
P = InterX([x y]') ;
plot(x,y,'b') ;
hold on
plot(P(1,:),P(2,:),'*r')

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by