Curve Intersect 2
General
This file is based on the Curve Intersect function by Duane Hanselman. It extends the scope of the function to handle arbitrary lines / polygons, which may also have vertical segments or segments with non-increasing x-values.
Description
Calculate the intersection points of two 2D-lines / polygons.
Usage
[X,Y]=CURVEINTERSECT(H1,H2) or [X,Y]=CURVEINTERSECT([H1 H2]) or
[X,Y]=CURVEINTERSECT(X1,Y1,X2,Y2) or
-> (H1,H2) handles to line objects
-> (Xi,Yi) coordinates of lines
-> (X,Y) coordinates of intersection
Example
x1=rand(10,1); y1=rand(10,1); x2=rand(10,1); y2=rand(10,1);
[x,y]=curveintersect(x1,y1,x2,y2);
plot(x1,y1,'k',x2,y2,'b',x,y,'ro')
Citation pour cette source
Sebastian Hölz (2026). Curve Intersect 2 (https://fr.mathworks.com/matlabcentral/fileexchange/8908-curve-intersect-2), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
Tags
Remerciements
A inspiré : Fast and Robust Curve Intersections, Minimum distance between two polygons
Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
CurveIntersect/
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.0.0 | Fixed small bug reported by Vadim Moldavsky |
