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

From STX Wiki
Jump to navigationJump to search
(Created page with '{{DISPLAYTITLE:{{SUBPAGENAME}}}} Calculate the hull polygon of two polygons. ;Usage: :<code>pghull(<var>X</var>, <var>IX</var>, <var>Y</var>, <var>IY</var>)</code> :;<var>X</var>…')
 
No edit summary
Line 4: Line 4:
:<code>pghull(<var>X</var>, <var>IX</var>, <var>Y</var>, <var>IY</var>)</code>
:<code>pghull(<var>X</var>, <var>IX</var>, <var>Y</var>, <var>IY</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> < <code>[[../pgget|pgget]](''X'')</code>
:;<var>IX</var>:the index of a polygon of ''X''; 0 <= <var>IX</var> < <code>[[../pgget|pgget]](''X'')</code>
:;<var>DX, DY</var>: shift values for x and y (default=0, no shift)
:;<var>Y</var>:a [[../#polygons|closed point-list]] or a [[../#polygons|polygon-stream]] defining one or more polygons.
::* shift the center point <code><xc,yc></code> of ''X<sub>IX</sub>''
:;<var>IY</var>:the index of a polygon of ''Y''; 0 <= <var>IY</var> < <code>[[../pgget|pgget]](''Y'')</code>
:::<code><x[i] , y[i]> -> <x[i]+<var>DX</var> , y[i]+<var>DY</var>></code>
;Result: The result ''r'' is a [[../#polygons|polygon-stream]] containing the hull polygon of ''X<sub>IX</sub>'' and ''Y<sub>IY</sub>''. The function fails if the two polygons have no overlapping regions.
:;<var>KX, KY</var>: scaling factors; both factors must be greater than zero (default=1, no scaling)
;See also: [[../pginit|pginit]], [[../pgget|pgget]], [[../pgitest|pgitest]], [[../pgiline|pgiline]], [[../pgxgrid|pgxgrid]], [[../pgsplit|pgsplit]], [[../pgtrans|pgtrans]]
::* scale the distances of corners of ''X<sub>IX</sub>'' to the center point
:::<code><x[i] , y[i]> -> <(x[i]-xc)*<var>KX</var>+xc , (y[i]-yc)*<var>KY</var>'+yc></code>
:;<var>A</var>: rotation angle in degree (default=0, no rotation); a scaling factors (default=1)
::*rotate the polygon around the center point
;Result: The result ''r'' is a [[../#polygons|polygon-stream]] containing the transformed ''X<sub>IX</sub>''.
;See also: [[../pginit|pginit]], [[../pgget|pgget]], [[../pgitest|pgitest]], [[../pgiline|pgiline]], [[../pgxgrid|pgxgrid]], [[../pgsplit|pgsplit]], [[../pghull|pghull]]


[[../#Functions|<function list>]]
[[../#Functions|<function list>]]

Revision as of 10:22, 20 April 2011

Calculate the hull polygon of two polygons.

Usage
pghull(X, IX, Y, IY)
X
a closed point-list or a polygon-stream defining one or more polygons.
IX
the index of a polygon of X; 0 <= IX < pgget(X)
Y
a closed point-list or a polygon-stream defining one or more polygons.
IY
the index of a polygon of Y; 0 <= IY < pgget(Y)
Result
The result r is a polygon-stream containing the hull polygon of XIX and YIY. The function fails if the two polygons have no overlapping regions.
See also
pginit, pgget, pgitest, pgiline, pgxgrid, pgsplit, pgtrans

<function list>

Navigation menu

Personal tools