Programmer Guide/Command Reference/EVAL/pgitest: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
:<code>pgitest(<var>X</var>, <var>IX</var>, <var>PX<sub>scalar</sub></var>, <var>PY<sub>scalar</sub></var>)</code> | :<code>pgitest(<var>X</var>, <var>IX</var>, <var>PX<sub>scalar</sub></var>, <var>PY<sub>scalar</sub></var>)</code> | ||
:;<var>X</var>:a [[../#polygons|closed point-list]] or a [[../#polygons|polygon-stream]] defining one or more polygons. | :;<var>X</var>:a [[../#polygons|closed point-list]] or a [[../#polygons|polygon-stream]] defining one or more polygons. | ||
:;<var>IX</var>:The index of the polygon of ''X'' to be tested; 0 <= <var>IX</var> < | :;<var>IX</var>:The index of the polygon of ''X'' to be tested; 0 <= <var>IX</var> < <code>[[../pgget|pgget]](''X'')</code>) | ||
:;<var>PX, PY</var>: The point ''P''=<''PX'',''PY''> to be tested. | :;<var>PX, PY</var>: The point ''P''=<''PX'',''PY''> to be tested. | ||
;Result 1: The result ''r'' is a scaler. | ;Result 1: The result ''r'' is a scaler. |
Revision as of 07:49, 20 April 2011
Check the relation (outside, inside, overlap) of a given point, line or simple polygon p to the polygon x.
- Usage 1
pgitest(X, IX, PXscalar, PYscalar)
- X
- a closed point-list or a polygon-stream defining one or more polygons.
- IX
- The index of the polygon of X to be tested; 0 <= IX <
pgget(X)
) - PX, PY
- The point P=<PX,PY> to be tested.
- Result 1
- The result r is a scaler.
r=0 ... point P is outside the polygon r=1 ... point P is inside the polygon
pgitest(X, I, PXscalar, PYvector)
pgitest(X, I, PXvector, PYscalar)
pgitest(X, I, PXvector, PYvector)
- X
- A closed point-list or a polygon-stream defining one or more polygons.
- Result 1
- The number of simple polygons N stored in X. If the result is 0, X contains no valid polygons.
- Usage 2
pgget(X, I, fmt)
- X
- A closed point-list or a polygon-stream defining one or more polygons.
- I
- The index of the polygon to be returned; 0 <= I < N (=
pgget(X)
) - fmt
- The format of the result.:
fmt=0 ... return the I-th polygon of X as polygon-stream fmt=1 ... return the polygon-stream header (a 8x2 matrix) of the I-th polygon of X
- Result 2
- The I-th polygon stored in X in the format selected by fmt.