Grid of points within a polygon

This function generates an array of points that lie within a given polygon
1,7K téléchargements
Mise à jour 8 mai 2013

Afficher la licence

inPoints = polygrid(xv,yv,ppa) generates points that are within a polygon using help from the inpolygon function.

xv and yv are columns representing the vertices of the polygon, as used in the Matlab function inpolygon

ppa refers to the points per unit area you would like inside the polygon. Here unit area refers to a 1.0 X 1.0 square in the axes.

Example:
L = linspace(0,2.*pi,6); xv = cos(L)';yv = sin(L)'; %from the inpolygon documentation
inPoints = polygrid(xv, yv, 10^5)
plot(inPoints(:, 1),inPoints(:,2), '.k');

Citation pour cette source

Sulimon Sattari (2026). Grid of points within a polygon (https://fr.mathworks.com/matlabcentral/fileexchange/41454-grid-of-points-within-a-polygon), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2013a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Version Publié le Notes de version
1.8.0.0

fixed a typo

1.7.0.0

Updated text to go with my previous file update

1.6.0.0

Better syntax and running time

1.5.0.0

clarified description

1.0.0.0