Code covered by the BSD License  

Highlights from
Fast and Robust Self-Intersections

5.0

5.0 | 2 ratings Rate this file 3 Downloads (last 30 days) File Size: 3.36 KB File ID: #13351
image thumbnail

Fast and Robust Self-Intersections

by Antoni J. Canós

 

11 Dec 2006 (Updated 13 Dec 2006)

Computes the self-intersections of a curve.

| Watch this File

File Information
Description

This function computes the locations where a curve self-intersects in a fast and robust way. The curve can be broken with NaNs or have vertical segments. Segments of the curve involved in each of the self-interesections are also provided.

Example of use:
N=201;
th=linspace(-3*pi,4*pi,N);
R=1;
x=R*cos(th)+linspace(0,6,N);
y=R*sin(th)+linspace(0,1,N);
t0=clock;
[x0,y0,segments]=selfintersect(x,y)
etime(clock,t0)
plot(x,y,'b',x0,y0,'.r');
axis ('equal'); grid

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Fast and Robust Curve Intersections

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
24 Jan 2008 Joseph Marks

This is really great !!!

And I just needed it, too !!!

THANKS VERY MUCH !!!

Sincerely,
Joseph

14 May 2009 Robert Beardmore

It certainly is very good and saved me a lot of bother!!

08 Jul 2010 Evgeny Pr  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
self intersect intersections cross curve line Antoni J. Canós 22 Oct 2008 08:52:03
self intersect intersections cross curve line Peter Chang 11 Dec 2008 12:21:26

Contact us at files@mathworks.com