Programmer Guide/Command Reference/EVAL/pgitest: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 12: Line 12:
|-
|-
|''r''='''1''' || ... point ''P'' is inside the polygon
|''r''='''1''' || ... point ''P'' is inside the polygon
|}
----
;Usage 1:
:<code>pgitest(<var>X</var>, <var>IX</var>, <var>PX<sub>scalar</sub></var>, <var>PY<sub>vector</sub></var>)</code>
:<code>pgitest(<var>X</var>, <var>IX</var>, <var>PX<sub>vector</sub></var>, <var>PY<sub>scalar</sub></var>)</code>
:<code>pgitest(<var>X</var>, <var>IX</var>, <var>PX<sub>vector</sub></var>, <var>PY<sub>vector</sub></var>)</code>
:;<var>PX, PY</var>: The points ''P''[i]=<''PX''[i],''PY''[i]> to be tested. One of these arguments must be a vector.
;Result 1: The result ''r'' is a vector containing the test result for each point ''P''[i].
::{|class="keinrahmen"
|''r''[i]='''0''' || ... point ''P''[i] is outside the polygon
|-
|''r''[i]='''1''' || ... point ''P''[i] is inside the polygon
|}
|}


:<code>pgitest(<var>X</var>, <var>I</var>, <var>PX<sub>scalar</sub></var>, <var>PY<sub>vector</sub></var>)</code>
:<code>pgitest(<var>X</var>, <var>I</var>, <var>PX<sub>vector</sub></var>, <var>PY<sub>scalar</sub></var>)</code>
:<code>pgitest(<var>X</var>, <var>I</var>, <var>PX<sub>vector</sub></var>, <var>PY<sub>vector</sub></var>)</code>





Revision as of 07:54, 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

Usage 1
pgitest(X, IX, PXscalar, PYvector)
pgitest(X, IX, PXvector, PYscalar)
pgitest(X, IX, PXvector, PYvector)
PX, PY
The points P[i]=<PX[i],PY[i]> to be tested. One of these arguments must be a vector.
Result 1
The result r is a vector containing the test result for each point P[i].
r[i]=0 ... point P[i] is outside the polygon
r[i]=1 ... point P[i] is inside the polygon


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.

See also
pginit, pgitest, pgiline, pgxgrid, pgsplit, pgtrans, pghull


<function list>

Navigation menu

Personal tools