Previous Up Next

11.16.4  Check if a point is in a polygon or circle: is_inside

The is_inside command is a Boolean function which takes two arguments, a point and a polygon or circle.

is_inside returns 1 if the point is inside the polygon or circle (including the boundary) and returns 0 otherwise.
Input:

is_inside(0,circle(-1,1))

Output:

1

Input:

is_inside(2,polygon([1,2-i,3+i]))

Output:

1

Input:

is_inside(1-i, triangle([1,2-i,3+i]))

Output:

0

Previous Up Next