Function: inpoly

Syntax

inpoly (<point>,<points[ ]>)

Type

numeric

Returns

The status of a point with regard to a polygon. Two values are returned:

1) proximity status: -1 (point is outside), 0 (point is on edge), 1 (point is inside),

2) distance from point to the nearest edge.

Parameters

Examples

The following returns the values 0 and 0.

point myps[] = <p0,e:100,n:100,w:100>
numeric stat[2] = inpoly(p0,myps)

The following returns the values 1 and 50.

stat = inpoly((50,50,0),myps)

The following returns the values -1 and 50.

stat = inpoly((50,-50,0),myps)

See Also

Functions:

inbox (numeric)