inpolygon edit page

checks which grains are within given polygon

Syntax

ind = inpolygon(grains,[xmin,ymin,dx,dy]) % select indices by rectangle
ind = inpolygon(grains,[x1 y1; x2 y2; x3 y3; x4 y4]) % select indices by poylgon
grains = grains(ind) % select grains data by indices

Input

grains grain2d
xmin, xmax lower left corner of a rectangle
dx, dy extent of a rectangle
x, y vertices of a polygon

Output

ind logical

See also

inpolygon