Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

POLYGON returns properties of an area enclosed by a polygon in two dimensions relative to lines, axes and points:

  • properties of an area enclosed by a polygon in two dimensions or;
  • properties of a line section within a polygon in two dimensions or;
  • Information on whether a point is located inside or outside a polygon in two dimensions.

Syntax

  1. POLYGON(Pno%, Ndim%[=2], "ColLab$_1", "ColLab$_2", X0, Y0, XN, YN, Mode%)
  2. POLYGON(0, Npoints%, X_11, Y_12, X_21, Y_22,.., X_n1, Y_n2, X0, Y0, XN, YN, Mode%)
  3. POLYGON(@ObjFn(..), Ndim%[=2], @ObjColPar_1, @ObjColPar_2, X0, Y0, XN, YN, Mode%)
  4. POLYGON(Telitab$, Ndim%[=2], "ColLab$_1", "ColLab$_2", X0, Y0, XN, YN, Mode%)

...

  • Pno% is the number that refers to the TeLiTab sets in the Data slot. Pno% should be an integer value or a parameter which is assigned an integer value and is the number of theTeLiTab set in the expressions data slot.
  • Ndim% is the number of dimensions, which is 2 for the POLYGON function.
  • Npoints% is the number of points (X,Y) that are given in direct definition.
  • @ObjFn() refers to the Object from which data will be used.
  • TeLiTab$ refers to the string parameter that contains the TeLiTab data to be used.
  • "ColLab$_1" and @ObjColPar_1 refer to the column containing the first values.
  • "ColLab$_2" and @ObjColPar_2 refer to the column containing the second values.
  • X_11, Y_12, X_21, Y_22,.., X_n1, Y_n2 are the X and Y coordinates of the points of the polygon that are given in the direct definition.
  • X0, Y0 are the X and Y coordinates of point (X0, Y0).
  • XN, YN are the X and Y coordinates of point (XN, YN).
  • Mode% is the option of the function. There are 25 mode. See Remarks for all options.

Remarks

POLYGON can be used in the following ways:

...

For Mode% = 1 to 15 the function POLYGON returns a property of the polygon.

...

For Mode% = 16 to 24 the function POLYGON returns properties of a line section within a polygon in two dimensions.

...

For Mode% = 25 to 27 the function POLYGON returns "1" when point (X0, Y0) is inside the polygon and "0" when it is outside the polygon .

...

Example 1: Syntax 1 (telitab in dataslot), Properties of the area 

The relation

POLYGON(1, 2, "XC", "YC", 0, 0, 0, 0, Mode)

contains the following Telitab set in the Data slot: 

|POLYGON1| 

2 "XC" "YC" 
"1" 0 0 
"2" 1 0 
"3" 1 1 
"4" 0 1|

...

Example 2: Syntax 1 (telitab in dataslot), Properties of a line section

The function:

POLYGON(1, 2, "XC", "YC", X0, Y0, XN, YN, Mode)

...

Example 3: Syntax 1 (telitab in dataslot), Information on wheter a point  is located inside or outside the polygon 

The function:

POLYGON(1, 2, "XC", "YC", X0, Y0, 0, 0, Mode)

...


In direct definition, the points of the polygon are stated in the relation itself:

POLYGON(0, Npoints%, X_11, Y_12, X_21, Y_22,.., X_n1, Y_n2, X0, Y0, XN, YN, Mode%)

The minimum number of (X,Y) data points Npoints% in the list is 3 in which case the polygon is a triangle.

The syntax

POLYGON(0, 4, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, Mode)

is the same polygon as in the previous examples and e.g. for Mode = 1, the area of the polygon is returned: 1.00 

...