26.15.4 Checking whether a point is in a polygon or circle
The
is_inside
command determines whether or not a point is in a polygon or a circle.
is_inside
takes two arguments:
P
, a point.
C
, a polygon or a circle.
is_inside(
P
,
C
)
returns 1 if
P
is inside
C
(including the boundary) and 0 otherwise.
Examples
is_inside
(0,
circle
(-1,1))
1
is_inside
(2,
polygon
([1,2-
i
,3+
i
]))
1
is_inside
(1-
i
,
triangle
([1,2-
i
,3+
i
]))
0