Points Inside polygone

Version 1.0.0.0 (858 Bytes) von Per Sundqvist
Finds those points (xi,yi) who are inside the polygon, defined by the vectors (x,y)
2K Downloads
Aktualisiert 22. Nov 2004

Keine Lizenz

Find those points (xi,yi) who are inside the polygone defined by the vectors (x,y).

Syntax: [xin,yin,Ind]=Inside(X,Y,xi,yi)

where Ind is the index of (xi,yi) that are inside the polygone

Example:

%--- create polygone (x,y)
phi=linspace(0,2*pi,50);
X=(1+0.2*sin(6*phi)).*cos(phi);
Y=(1+0.2*sin(6*phi)).*sin(phi);
%--- random points (xi,yi)
Nr=20;
xi=randn(1,Nr);yi=randn(1,Nr);
[xin,yin,Ind]=Inside(X,Y,xi,yi);
%--- plot
plot(X,Y,X,Y,'.',xi,yi,'ro',xin,yin,'b.');axis equal;

Zitieren als

Per Sundqvist (2026). Points Inside polygone (https://de.mathworks.com/matlabcentral/fileexchange/6311-points-inside-polygone), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R13
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Elementary Polygons finden Sie in Help Center und MATLAB Answers
Version Veröffentlicht Versionshinweise
1.0.0.0