Product help with community knowledge

### Page statistics

314 views1 edit(s)3904 characters(s) Page last modified 18:15, 15 Jan 2013 by contentconnector

# pointInPolygon?()

1. 1. Synopsis
2. 2. Syntax
3. 3. Example 1
4. 4. Example 2
5. 5. Example 3

## Synopsis

Returns True if pt lies inside the polygon described by the point list poly.

Polygons are represented in a "lightweight" way by a list of points. The first three non-colinear points define the "plane" of the polygon, and even if the rest of the points do not lie in that plane, they will be projected onto that plane for all computations.

## Syntax

```pointInPolygon? ( pt As Point, _
poly As List ) As Boolean ```
Argument Type Description
pt Point The point to be tested.
poly List The point list defining the polygon.

## Example 1

```Intent >pointInPolygon?(point(1,1,0), {Point(0,0,0), Point(2,0,0), Point(1,2,0)})
--> True ```

## Example 2

```Intent >pointInPolygon?(point(2,1,0), {Point(0,0,0), Point(2,0,0), Point(1,2,0)})
--> False ```

## Example 3

Points lying ON the polygon boundary are ambiguous; they are sometimes reported as out, and sometimes in, depending on the particular numbers involved. True implies "inside or on", but False does not imply "not on" the boundary.

```Intent >pointInPolygon?(point(1,0,0), {Point(0,0,0), Point(2,0,0), Point(1,2,0)})
--> True ```