# doc-cache created by Octave 5.1.0
# name: cache
# type: cell
# rows: 3
# columns: 44
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
clipPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2994
 -- Function File: [OUTPOL, NPOL] = clipPolygon (INPOL, CLIPPOL, OP)
 -- Function File: [OUTPOL, NPOL] = clipPolygon (INPOL, CLIPPOL, OP,
          LIBRARY)
 -- Function File: [OUTPOL, NPOL] = clipPolygon (..., ARGS)
     Perform boolean operation on polygon(s) using one of boolean
     methods.

     INPOL = Nx2 matrix of (X, Y) coordinates constituting the
     polygons(s) to be clipped.  Polygons are separated by [NaN NaN]
     rows.  CLIPPOL = another Nx2 matrix of (X, Y) coordinates
     representing the clip polygon(s).

     The argument OP, the boolean operation, can be:

        * 0: difference INPOL - CLIPPOL

        * 1: intersection ("AND") of INPOL and CLIPPOL (= default)

        * 2: exclusiveOR ("XOR") of INPOL and CLIPPOL

        * 3: union ("OR") of INPOL and CLIPPOL

     The optional argument LIBRARY specifies which library to use for
     clipping.  Currently only "clipper" is implemented.

     Output array OUTPOL will be an Nx2 array of polygons resulting from
     the requested boolean operation, or in case of just one input
     argument an Nx1 array indicating winding direction of each
     subpolygon in input argument INPOL.

     Optional output argument NPOL indicates the number of output
     polygons.

     The optional input arguments ARGS are used to pass additonal
     arguments to the underlying library.  Clipper library allows a rule
     to be specified about how to assess holes, or rather, how to assess
     polygon fill.  This works as follows: start with a winding number
     of zero (0).  From a point outside all polygons specified in INPOL,
     go to the center of the innermost polygon and note which polygons
     are crossed.  For each polygon boundary crossing from right to
     left, increase the winding number, while for each polygon crossing
     from left to right, decrement it, and then assign it to the crossed
     polygon.  By passing two extra arguments RULES and RULEC the user
     can be set rules individually for subject and clip polygons,
     respectively, as follows:

        * 0 Even-Odd, also called Alternate (= default): The first
          polygon crossed specifies the outer boundary of a filled
          polygon, the next polygon (if present) specifies the inner
          boundary of that filled polygon, and so on.  Winding direction
          (clockwise or counterclockwise) is irrelevant here.

        * 1 Non-Zero: All polygons with a non-zero winding number are
          filled.

        * 2 Positive: All polygons with a winding number > 0 are filled.
          This is the usual setting for counterclockwise polygons to be
          the outer, and clockwise polygons to be the inner boundary
          ("holes") of complex polygons.

        * 3 Negative: All polygons with a winding number < 0 are filled.
     (for details see
     http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Types/PolyFillType.htm

     See also: clipPolygon_clipper, clipPolyline.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Perform boolean operation on polygon(s) using one of boolean methods.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
clipPolygon_clipper


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2632
 -- Function File: [OUTPOL, NPOL] = clipPolygon_clipper (INPOL, CLIPPOL)
 -- Function File: [OUTPOL, NPOL] = clipPolygon_clipper (INPOL, CLIPPOL,
          OP)
 -- Function File: [OUTPOL, NPOL] = clipPolygon_clipper (INPOL, CLIPPOL,
          OP, RULES, RULEC)
     Perform boolean operation on polygon(s) using one of boolean
     methods.

     INPOL = Nx2 matrix of (X, Y) coordinates constituting the
     polygons(s) to be clipped.  Polygons are separated by [NaN NaN]
     rows.  CLIPPOL = another Nx2 matrix of (X, Y) coordinates
     representing the clip polygon(s).

     Optional argument OP, the boolean operation, can be:

        * 0: difference INPOL - CLIPPOL

        * 1: intersection ("AND") of INPOL and CLIPPOL (= default)

        * 2: exclusiveOR ("XOR") of INPOL and CLIPPOL

        * 3: union ("OR") of INPOL and CLIPPOL

     In addition a rule can be specified to instruct polyclip how to
     assess holes, or rather, how to assess polygon fill.  This works as
     follows: start with a winding number of zero (0).  From a point
     outside all polygons specified in INPOL, go to the center of the
     innermost polygon and note which polygons are crossed.  For each
     polygon boundary crossing from right to left, increase the winding
     number, while for each polygon crossing from left to right,
     decrement it, and then assign it to the crossed polygon.  RULES and
     RULEC can be set individually for subject and clip polygons,
     respectively, as follows:

        * 0 Even-Odd, also called Alternate (= default): The first
          polygon crossed specifies the outer boundary of a filled
          polygon, the next polygon (if present) specifies the inner
          boundary of that filled polygon, and so on.  Winding direction
          (clockwise or counterclockwise) is irrelevant here.

        * 1 Non-Zero: All polygons with a non-zero winding number are
          filled.

        * 2 Positive: All polygons with a winding number > 0 are filled.
          This is the usual setting for counterclockwise polygons to be
          the outer, and clockwise polygons to be the inner boundary
          ("holes") of complex polygons.

        * 3 Negative: All polygons with a winding number < 0 are filled.
     (for details see
     http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Types/PolyFillType.htm

     Output array OUTPOL will be an Nx2 array of polygons resulting from
     the requested boolean operation, or in case of just one input
     argument an Nx1 array indicating winding direction of each
     subpolygon in input argument INPOL.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Perform boolean operation on polygon(s) using one of boolean methods.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
clipPolyline


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 910
 -- OLINE = polylineClip (INPOL, CLIPPOL, OP)
     Clip (possibly composite) polylines with polygon(s) using one of
     boolean methods.

     INPOL = Nx2 matrix of (X, Y) coordinates constituting the
     polylines(s) to be clipped.  Polyline sections are separated by
     [NaN NaN] rows.  CLIPPOL = another Nx2 matrix of (X, Y) coordinates
     representing the clip polygon(s).  CLIPPOL may comprise separate
     and/or concentric polygons (the latter with holes).

     The argument OP, the boolean operation, can be:

        * 0: difference INPOL - CLIPPOL

        * 1: intersection ("AND") of INPOL and CLIPPOL (= default)

     Output array OLINE will be an Nx2 array of polyline sections
     resulting from the requested boolean operation.

     The optional argument LIBRARY specifies which library to use for
     clipping.  Currently only "clipper" is implemented.

     See also: clipPolygon.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Clip (possibly composite) polylines with polygon(s) using one of boolean
meth...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
clipPolyline_clipper


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 870
 -- Function File: [OLIN, NLIN] = clipPolyline_clipper (INLIN, CLIPPOL)
 -- Function File: [OLIN, NLIN] = clipPolyline_clipper (INLIN, CLIPPOL,
          OP)
     Clip (possibly composite) polylines with polygon(s) using one of
     boolean methods.

     INPOL = Nx2 matrix of (X, Y) coordinates constituting the
     polylines(s) to be clipped.  Polyline sections are separated by
     [NaN NaN] rows.  CLIPPOL = another Nx2 matrix of (X, Y) coordinates
     representing the clip polygon(s).  CLIPPOL may comprise separate
     and/or concentric polygons (the latter with holes).

     Optional argument OP, the boolean operation, can be:

        * 0: difference INPOL - CLIPPOL

        * 1: intersection ("AND") of INPOL and CLIPPOL (= default)

     Output array OLINE will be an Nx2 array of polyline sections
     resulting from the requested boolean operation.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Clip (possibly composite) polylines with polygon(s) using one of boolean
meth...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
convexHull


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1118
CONVEXHULL Convex hull of a set of points

   POLY = convexHull(POINTS)
   Computes the convex hull of the set of points POINTS. This function is
   mainly a wrapper to the convhull function, that format the result to a
   polygon.

   [POLY, INDS] = convexHull(POINTS)
   Also returns the indices of convex hull vertices within the original
   array of points.

   ... = convexHull(POINTS, 'simplify', BOOL)
   specifies the 'simplify' option use dfor calling convhull. By default,
   the convexHull functions uses simplify equals to TRUE (contrary to the
   convhull function), resulting in a more simple convex polygon.
   
   
   Example
     % Draws the convex hull of a set of random points
     pts = rand(30,2);
     drawPoint(pts, '.');
     hull = convexHull(pts);
     hold on; 
     drawPolygon(hull);

     % Draws the convex hull of a paper hen
     x = [0 10 20  0 -10 -20 -10 -10  0];
     y = [0  0 10 10  20  10  10  0 -10];
     poly = [x' y'];
     hull = convexHull(poly);
     figure; drawPolygon(poly);
     hold on; axis equal;
     drawPolygon(hull, 'm');

   See also
   polygons2d, convhull



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CONVEXHULL Convex hull of a set of points



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
curvature


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1033
 -- Function File: KAPPA = curvature (T, PX, PY,METHOD,DEGREE)
 -- Function File: KAPPA = curvature (T, POLY,METHOD,DEGREE)
 -- Function File: KAPPA = curvature (PX, PY,METHOD,DEGREE)
 -- Function File: KAPPA = curvature (POINTS,METHOD,DEGREE)
 -- Function File: [KAPPA POLY T] = curvature (...)
     Estimate curvature of a polyline defined by points.

     First compute an approximation of the curve given by PX and PY,
     with the parametrization T.  Then compute the curvature of
     approximated curve for each point.  METHOD used for approximation
     can be only: 'polynom', with specified degree.  Further methods
     will be provided in a future version.  T, PX, and PY are N-by-1
     array of the same length.  The points can be specified as a single
     N-by-2 array.

     If the argument T is not given, the parametrization is estimated
     using function 'parametrize'.

     If requested, POLY contains the approximating polygon evlauted at
     the parametrization T.

     See also: parametrize, polygons2d.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Estimate curvature of a polyline defined by points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
distancePointPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 226
 -- Function File: DIST = distancePointPolygon (POINT,POLY)
     Compute shortest distance between a point and a polygon

     See also: polygons2d, points2d, distancePointPolyline,
     distancePointEdge, projPointOnPolyline.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Compute shortest distance between a point and a polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
distancePointPolyline


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 735
 -- Function File: DIST = distancePointPolyline (POINT,POLY)
 -- Function File: [DIST POS] = distancePointPolyline (POINT,POLY)
     Compute shortest distance DIST between a point and a polyline

     If the the second output argument POS is requested, the function
     also returns the position of closest point on the polyline.  POS is
     comprised between 0 and NV, the number of polyline vertices.

     Example:
                pt1 = [30 20];
                pt2 = [30 5];
                poly = [10 10;50 10;50 50;10 50];
                distancePointPolyline([pt1;pt2], poly)
                ans =
                    10
                     5

     See also: polygons2d, points2d,distancePointEdge,
     projPointOnPolyline.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Compute shortest distance DIST between a point and a polyline



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
distancePolygons


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 110
 -- Function File: DIST = distancePolygons (POLY1,POLY2)
     Compute the shortest distance between 2 polygons


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Compute the shortest distance between 2 polygons



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
drawPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1109
 -- Function File: H = drawPolygon (COORD)
 -- Function File: H = drawPolygon (PX, PY)
 -- Function File: H = drawPolygon (POLYS)
 -- Function File: H = drawPolygon (AX, ...)
     Draw a polygon specified by a list of points.

     drawPolygon (COORD): Packs coordinates in a single N-by-2 array in
     the form: '[X1, Y1; X2, Y2; ... ; XN, YN]'.  Multiple polygons may
     be drawn by using '[...; NaN, NaN; ...]' as a separator between
     coordinate sets.

     drawPolygon (PX, PY): Specifies coordinates with X and Y components
     in separate column vectors.

     drawPolygon (POLYS): Packs coordinate of several polygons in a cell
     array.  Each element of the cell array, POLYS, is a N-by-2 double
     array using the same form as described for COORD above.

     drawPolygon (AX, ...): Specifies the axis, AX, to draw the polygon
     on.

     H = drawPolygon (...): Also return a handle to the list of line
     objects.

     For more complete explanation of the polygon format and functions
     the user should reference the 'polygons2d' function.

     See also: polygons2d, drawCurve.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Draw a polygon specified by a list of points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawPolyline


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1068
 -- Function File: = drawPolyline (, )
     DRAWPOLYLINE Draw a polyline specified by a list of points

     drawPolyline(COORD); packs coordinates in a single [N*2] array.

     drawPolyline(PX, PY); specifies coordinates in separate arrays.  PX
     and PY must be column vectors with the same length.

     drawPolyline(..., TYPE); where TYPE is either 'closed' or 'open',
     specifies if last point must be connected to the first one
     ('closed') or not ('open').  Default is 'open'.

     drawPolyline(..., PARAM, VALUE); specify plot options as described
     for plot command.

     H = drawPolyline(...)  also return a handle to the list of line
     objects.

     Example:
            # Draw a curve representing an ellipse
            t = linspace(0, 2*pi, 100)';
            px = 10*cos(t); py = 5*sin(t);
            drawPolyline([px py], 'closed');
            axis equal;

            # The same, with different drawing options
            drawPolyline([px py], 'closed', 'lineWidth', 2, 'lineStyle', '--');

     See also: polygons2d, drawPolygon.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
DRAWPOLYLINE Draw a polyline specified by a list of points



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
expandPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 911
 -- Function File: LOOPS = expandPolygon (POLY, DIST)
     Expand a polygon by a given (signed) distance

     Associates to each edge of the polygon POLY the parallel line
     located at distance DIST from the current edge, and compute
     intersections with neighbor parallel lines.  The resulting polygon
     is simplified to remove inner "loops", and can be disconnected.
     The result is a cell array, each cell containing a simple linear
     ring.

     This is a kind of dilation, but behaviour on corners is different.
     This function keeps angles of polygons, but there is no direct
     relation between length of 2 polygons.

     It is also possible to specify negative distance, and get all
     points inside the polygon.  If the polygon is convex, the result
     equals morphological erosion of polygon by a ball with radius equal
     to the given distance.

     See also: polygons2d.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Expand a polygon by a given (signed) distance



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
fillPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 612
 -- Function File: H = fillPolygon (P)
 -- Function File: H = fillPolygon (PX,PY)
     Fill a polygon specified by a list of points

     P is a single [N*2] array.  With one input argument, it fills the
     interior of the polygon specified by P.  The boundary of the
     polygon is not drawn, use 'drawPolygon' to do it.

     If P contains NaN-couples, each portion between the [NaN;NaN] will
     be filled separately.

     Two input arguments specify coordinates of the polygon in separate
     arrays.

     Also returns a handle to the created patch.

     See also: polygons2d, drawCurve, drawPolygon.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Fill a polygon specified by a list of points



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
intersectEdgePolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 983
INTERSECTEDGEPOLYGON  Intersection point of an edge with a polygon

   INTER = intersectEdgePolygon(EDGE, POLY)
   Computes intersection(s) point(s) between the edge EDGE and the polygon
   POLY. EDGE is given by [x1 y1 x2 y2]. POLY is a N-by-2 array of vertex
   coordinates.
   INTER is a M-by-2 array containing coordinates of intersection(s). It
   can be empty if no intersection is found.

   [INTER INDS] = intersectEdgePolygon(EDGE, POLY)
   Also returns index/indices of edge(s) involved in intersections.

   Example
   % Intersection of an edge with a square
     poly = [0 0;10 0;10 10;0 10];
     edge = [9 2 9+3*1 2+3*2];
     exp = [10 4];
     inter = intersectEdgePolygon(edge, poly)
     ans =
         10   4

   See also
   edges2d, polygons2d, intersectLinePolygon, intersectRayPolygon

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-02-24,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
INTERSECTEDGEPOLYGON  Intersection point of an edge with a polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
intersectLinePolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1804
INTERSECTLINEPOLYGON Intersection points between a line and a polygon

   P = intersectLinePolygon(LINE, POLY)
   Returns the intersection points of the lines LINE with polygon POLY. 
   LINE is a 1-by-4 row vector containing parametric representation of the
   line (in the format [x0 y0 dx dy], see the function 'createLine' for
   details). 
   POLY is a NV-by-2 array containing coordinates of the polygon vertices
   P is a K-by-2 array containing the coordinates of the K intersection
   points.

   P = intersectLinePolygon(LINE, POLY, TOL)
   Specifies the tolerance for geometric tests. Default is 1e-14.

   [P INDS] = intersectLinePolygon(...)
   Also returns the indices of edges involved in intersections. INDS is a
   K-by-1 column vector, such that P(i,:) corresponds to intersection of
   the line with the i-th edge of the polygon. If the intersection occurs
   at a polygon vertex, the index of only one of the two neighbor edges is
   returned. 
   Note that due to numerical approximations, the use of function
   'isPointOnEdge' may give results not consistent with this function.


   Examples
   % compute intersections between a square and an horizontal line
     poly = [0 0;10 0;10 10;0 10];
     line = [5 5 1 0];
     intersectLinePolygon(line, poly)
     ans =
           10     5
            0     5
     % also return indices of edges
     [inters inds] = intersectLinePolygon(line, poly)
     inters =
           10     5
            0     5
     inds =
           4
           2
      
   % compute intersections between a square and a diagonal line
     poly = [0 0;10 0;10 10;0 10];
     line = [5 5 1 1];
     intersectLinePolygon(line, poly)
     ans =
            0     0
           10    10

   See Also
   lines2d, polygons2d, intersectLines, intersectRayPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
INTERSECTLINEPOLYGON Intersection points between a line and a polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
intersectPolylines


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1059
INTERSECTPOLYLINES Find the common points between 2 polylines

   INTERS = intersectPolylines(POLY1, POLY2)
   Returns the intersection points between two polylines. Each polyline is
   defined by a N-by-2 array representing coordinates of its vertices: 
   [X1 Y1 ; X2 Y2 ; ... ; XN YN]
   INTERS is a NP-by-2 array containing coordinates of intersection
   points.

   INTERS = intersectPolylines(POLY1)
   Compute self-intersections of the polyline.

   Example
   % Compute intersection points between 2 simple polylines
     poly1 = [20 10 ; 20 50 ; 60 50 ; 60 10];
     poly2 = [10 40 ; 30 40 ; 30 60 ; 50 60 ; 50 40 ; 70 40];
     pts = intersectPolylines(poly1, poly2);
     figure; hold on; 
     drawPolyline(poly1, 'b');
     drawPolyline(poly2, 'm');
     drawPoint(pts);
     axis([0 80 0 80]);

   This function is largely based on the 'interX' function, found on the
   FileExchange:
   https://fr.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections
   
   See also
   polygons2d, polylineSelfIntersections, intersectLinePolygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
INTERSECTPOLYLINES Find the common points between 2 polylines



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
isPointInPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 678
ISPOINTINPOLYGON Test if a point is located inside a polygon

   B = isPointInPolygon(POINT, POLYGON)
   Returns true if the point is located within the given polygon.

   This function is simply a wrapper for the function inpolygon, to avoid
   decomposition of point and polygon coordinates.

   Example
     pt1 = [30 20];
     pt2 = [30 5];
     poly = [10 10;50 10;50 50;10 50];
     isPointInPolygon([pt1;pt2], poly)
     ans =
          1
          0

     poly = [0 0; 10 0;10 10;0 10;NaN NaN;3 3;3 7;7 7;7 3];
     pts = [5 1;5 4];
     isPointInPolygon(pts, poly);
     ans =
          1
          0


   See also
   points2d, polygons2d, inpolygon, isPointInTriangle



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
ISPOINTINPOLYGON Test if a point is located inside a polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
isPolygonCCW


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 729
 -- CCW = isPolygonCCW (P)
 -- CCW = isPolygonCCW (PX, PY)
     Returns true if the polygon P are oriented Counter-Clockwise.

     P is a N-by-2 array containing coordinates of vertices.  The
     coordinates of the vertices of the polygon can also be given as two
     N-by-1 arrays PX, PY.

     Optional third argument LIBRARY can be one of "geometry" or
     "clipper".  In the latter case the potentially faster Clipper
     polygon library will be invoked to assess winding directions.  The
     default is "geometry".

     If any polygon is self-crossing, the result is undefined.

     If P is a cell, each element is considered a polygon, the resulting
     CWW is a cell of the same size.

     See also: polygonArea.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Returns true if the polygon P are oriented Counter-Clockwise.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
isPolygonCW_Clipper


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 491
 -- Function File: [ORIENTATION] = isPolygonCW_Clipper (INPOL)
     Inspect winding direction of polygon(s).

     Based on Clipper library (polyclipping.sf.net / 3rd Party / Matlab)

     INPOL = Nx2 matrix of (X, Y) coordinates constituting the
     polygons(s) whose winding direction should be assessed.
     Subpolygons are separated by [NaN NaN] rows.

     Output argument ORIENTATION contains the winding direction(s) of
     each subpolygon: 0 for clockwise, 1 for counterclockwise.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Inspect winding direction of polygon(s).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
joinPolygons


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 423
 -- OUTPOL = joinPolygons (INPOL)
     Convert a cell style set of polygons into an array of subpolygons
     separated by NaN rows.

     INPOL is expected to be an Nx1 (column) cell array with each cell
     containing a matrix of Mx1 (X), Mx2 (X,Y), or Mx3 (X,Y,Z)
     coordinates.

     OUTPOL is a numeric Px1, Px2 or Px3 array os subpolygons each
     separated by a row of NaN values.

     See also: splitPolygons.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Convert a cell style set of polygons into an array of subpolygons
separated b...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
medialAxisConvex


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 855
 -- Function File: [N E] = medialAxisConvex (POLYGON)
     Compute medial axis of a convex polygon

     POLYGON is given as a set of points [x1 y1;x2 y2 ...], returns the
     medial axis of the polygon as a graph.  N is a set of nodes.  The
     first elements of N are the vertices of the original polygon.  E is
     a set of edges, containing indices of source and target nodes.
     Edges are sorted according to order of creation.  Index of first
     vertex is lower than index of last vertex, i.e.  edges always point
     to newly created nodes.

     Notes: - Is not fully implemented, need more development (usually
     crashes for polygons with more than 6-7 points...)  - Works only
     for convex polygons.  - Complexity is not optimal: this algorithm
     is O(n*log n), but linear algorithms exist.

     See also: polygons2d, bisector.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Compute medial axis of a convex polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
minimumCaliperDiameter


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1072
MINIMUMCALIPERDIAMETER Minimum caliper diameter of a set of points

   WIDTH = minimumCaliperDiameter(POINTS)
   Computes the minimum width of a set of points. As polygons and
   polylines are represented as point lists, this function works also for
   polygons and polylines.

   [WIDTH THETA] = minimumCaliperDiameter(POINTS)
   Also returns the direction of minimum width. The direction corresponds
   to the horizontal angle of the edge that minimizes the width. THETA is
   given in radians, between 0 and PI.


   Example
   % Compute minimal caliper diameter, and check coords of rotated points
   % have expected extent
     points = randn(30, 2);
     [width theta] = minimumCaliperDiameter(points);
     points2 = transformPoint(points, createRotation(-theta));
     diff = max(points2) - min(points2);
     abs(width - diff(2)) < 1e-10
     ans =
         1

   References
   Algorithms use rotating caliper. Implementation was based on that of
   Wikipedia:
   http://en.wikipedia.org/wiki/Rotating_calipers

   See also
   polygons2d, convexHull, orientedBox



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
MINIMUMCALIPERDIAMETER Minimum caliper diameter of a set of points



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
orientPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 863
 -- Q = orientPolygon (P)
 -- ... = orientPolygon (P, [], DIR)
 -- [QX QY] = orientPolygon (PX, PY)
 -- ... = orientPolygon (PX, PY, DIR)
     Orient polygon counterclockwise or clockwise.

     P is a N-by-2 array containing coordinates of vertices.  The
     coordinates of the vertices of the polygon can also be given as two
     N-by-1 arrways PX, PY.  It can also be cells of polygons or NaN
     separated polygons.  The output has the same format as the input.

     The optional argument DIR can be "ccw" or "cw".  By default it
     orients polygon counterclockwise ('DIR == "ccw"').  To orient the
     polygon clockwise, use 'DIR == "cw"'.

     Holes are treated as independet polygons, that is a cw polygon with
     a cw hole will be seen as two cw polygons.

     If polygon is self-crossing, the result is undefined.

     See also: isPolygonCCW.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Orient polygon counterclockwise or clockwise.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
parametrize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1233
 -- Function File: PAR = parametrize (POLY)
 -- Function File: PAR = parametrize (PX,PY)
 -- Function File: PAR = parametrize (...,NORMALIZE)

     Parametrization of a curve, based on edges length

     Returns a parametrization of the curve defined by the serie of
     points, based on euclidean distance between two consecutive points.
     POLY is a N-by-2 array, representing coordinates of vertices.  The
     result PAR is N-by-1, and contains the cumulative length of edges
     until corresponding vertex.  The function also accepts the polygon
     as two inputs PX and PY representinx coordinates x and y
     respectively.  When optional argument NORMALIZE is non-empty PAR is
     rescaled such that the last element equals 1, i.e.  'PAR(end)==1'.

     Example
              # Parametrize a circle approximation
              poly = circleToPolygon([0 0 1], 200);
              p = parametrize(poly);
              p(end)
              ans =
                  6.2829
              p = parametrize(poly,'norm');
              p(end)
              ans =
                  1
              p = parametrize(poly,true);
              p(end)
              ans =
                  1

     See also: polygons2d, polylineLength.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Parametrization of a curve, based on edges length



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
polygon2patch


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1011
 -- XYO = polygon2patch (XYI)
 -- [XO, YO ] = polygon2patch (XI, YI)
 -- [XO, YO, ZO ] = polygon2patch (XI, YI, ZI)
     Connect outer (filled) polygon and inner (hole) polygons using
     branch cuts such that all polygons are connected as one string of
     vertices, for subsequent plotting polygons with holes using the
     function 'patch'.

     XYI can be a 2 or 3 dimensional array; only the X and Y coordinates
     will be optmized and Z-values will be kept with their original
     vertices.  Alternatively separate X, Y and optionally Z-vectors can
     be specified.  The outer polygon should appear as a first
     subvector, bounded by a row of NaN values, and have a
     counterclockwise winding direction.  All subsequent inner hole
     polygons should also be bounded by rows of NaN values and have
     clockwise winding directions.

     This function expects and returns column vectors or matrices where
     each row contains coordinates of a vertex.

     See also: drawPolygon, patch.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Connect outer (filled) polygon and inner (hole) polygons using branch
cuts su...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
polygon2shape


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 542
 -- Function File: SHAPE = polygon2shape (POLYGON)
     Converts a polygon to a shape with edges defined by smooth
     polynomials.

     POLYGON is a N-by-2 matrix, each row representing a vertex.  SHAPE
     is a N-by-1 cell, where each element is a pair of polynomials
     compatible with polyval.

     In its current state, the shape is formed by polynomials of degree
     1.  Therefore the shape representation costs more memory except for
     colinear points in the polygon.

     See also: shape2polygon, simplifyPolygon, polyval.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
Converts a polygon to a shape with edges defined by smooth polynomials.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
polygonArea


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1183
 -- Function File: AREA = polygonArea (POINTS)
 -- Function File: AREA = polygonArea (PX,PY)
     Compute the signed area of a polygon.

     Compute area of a polygon defined by POINTS.  POINTS is a N-by-2
     matrix containing coordinates of vertices.  The coordinates of the
     vertices of the polygon can also be given as two N-by-1 arrways PX,
     PY.

     Vertices of the polygon are supposed to be oriented
     Counter-Clockwise (CCW). In this case, the signed area is positive.
     If vertices are oriented Clockwise (CW), the signed area is
     negative.

     If polygon is self-crossing, the result is undefined.

     If the polygon contains holes the result is well defined only when
     the outer polygon is oriented CCW and the holes are oriented CW. In
     this case the resulting are is the sum of the signed areas.

     If POINTS is a cell, each element is considered a polygon and the
     area of each one is returned in the array AREA.  The matrix has the
     same shape as the cell.

     References: Algorithm adapted from P. Bourke web page
     http://paulbourke.net/geometry/polygonmesh/

     See also: polygons2d, polygonCentroid, drawPolygon.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Compute the signed area of a polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
polygonBounds


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 499
POLYGONBOUNDS Compute the bounding box of a polygon

   BOX = polygonBounds(POLY);
   Returns the bounding box of the polygon. 
   BOX has the format: [XMIN XMAX YMIN YMAX].

   Input polygon POLY is as a N-by-2 array containing coordinates of each
   vertex.
   Multiple polygons can be specified either by inserting NaN rows between
   vertex coordinates, or by using a cell array, each cell containing the
   vertex coordinates of a polygon loop.

   See also
   polygons2d, boxes2d, boundingBox



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
POLYGONBOUNDS Compute the bounding box of a polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
polygonCentroid


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 582
 -- Function File: [ PT, AREA ] = polygonCentroid (POINTS)
 -- Function File: [ ... ]= polygonCentroid (PTX,PTY)
     Compute the centroid (center of mass) of a polygon.

     Computes the center of mass of a polygon defined by POINTS.  POINTS
     is a N-by-2 matrix.  The two columns can be given separately using
     PTX and PTY for the x and y component respectively.

     The area of the polygon is returned in the second output argument.

     Adapted from
     <http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/>

     See also: polygons2d, polygonArea, drawPolygon.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Compute the centroid (center of mass) of a polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
polygonContains


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 526
POLYGONCONTAINS Test if a point is contained in a multiply connected polygon

   B = polygonContains(POLYGON, POINT);
   Returns TRUE if the (possibly multi-connected) polygon POLYGON contains
   the point(s) given by POINT.
   This is an extension of the Matlab function inpolygon for the case of
   polygons with holes.

   Example
   POLY = [0 0; 10 0;10 10;0 10;NaN NaN;3 3;3 7;7 7;7 3];
   PT = [5 1;5 4];
   polygonContains(POLY, PT);
   ans =
        1
        0

   See also
   polygons2d, inpolygon, isPointInPolygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
POLYGONCONTAINS Test if a point is contained in a multiply connected polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
polygonLoops


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 902
 -- Function File: LOOPS = polygonLoops (POLY)
      -- Function File: LOOPS = polygonLoops (POLY, TOL)
          Divide a possibly self-intersecting polygon into a set of
          simple loops

          POLY is a polygone defined by a series of vertices, The
          optional argument TOL defines the tolerance for detecting when
          two vertices are equal, default value 'sqrt (eps)'.  LOOPS is
          a cell array of polygons, containing the same vertices of the
          original polygon, but no loop self-intersect, and no couple of
          loops intersect each other.

          Example:
                     poly = [0 0;0 10;20 10;20 20;10 20;10 0];
                     loops = polygonLoops(poly);
                     figure(1); hold on;
                     drawPolygon(loops);
                     polygonArea(loops)

          See also: polygons2d, polygonSelfIntersections.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
Divide a possibly self-intersecting polygon into a set of simple loops



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
polygonPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
 -- Function File: POINT = polygonPoint (POLY, POS)
     Extract a point from a polygon

     See also: polygons2d, polylinePoint.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Extract a point from a polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
polygonSelfIntersections


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 920
 -- Function File: PTS = polygonSelfIntersections (POLY)
 -- Function File: [PTS POS1 POS2] = polygonSelfIntersections (POLY)
 -- Function File: [...] = polygonSelfIntersections (...,'tolerance',
          TOL)
     Find-self intersection points of a polygon

     Return the position of self intersection points

     Also return the 2 positions of each intersection point (the
     position when meeting point for first time, then position when
     meeting point for the second time).

     Specifies an additional tolerance parameter to decide whether two
     intersection points should be considered the same, based on their
     euclidean distance.

     Example
                # use a '8'-shaped polygon
                poly = [10 0;0 0;0 10;20 10;20 20;10 20];
                polygonSelfIntersections(poly)
                ans =
                    10 10

     See also: polygons2d, polylineSelfIntersections.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Find-self intersection points of a polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
polygonSubcurve


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 510
 -- Function File: POLY2 = polygonSubcurve (POLYGON, POS0,POS1)
     Extract a portion of a polygon

     Create a new polyline, by keeping vertices located between
     positions POS0 and POS1, and adding points corresponding to
     positions POS0 and POS1 if they are not already vertices.

     Example:
          Nv    = 100;
          poly  = circleAsPolygon ([10 20 30], Nv);
          poly2 = polygonSubcurve (poly, 15, 65);
          drawPolyline (poly2);

     See also: polygons2d, polylineSubcurve.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Extract a portion of a polygon



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
polygons2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6872
 -- Function File: polygons2d ()
     Description of functions operating on 2D polygons

     The 'polygons' module contains functions operating on shapes
     composed of a vertex list, like polygons or polylines.

     We call 'polyline' the curve defined by a series of vertices.  A
     polyline can be either closed or open, depending on whether the
     last vertex is connected to the first one or not.  This can be
     given as an option is some functions in the module.  A 'polygon' is
     the planar domain delimited by a closed polyline.  We sometimes
     want to consider 'complex polygons', whose boundary is composed of
     several disjoint domains.  The domain defined by a single closed
     polyline is called 'simple polygon'.  We call 'curve' a polyline
     with many vertices, such that the polyline can be considered as a
     discrete approximation of a "real" curve.

     A simple polygon or polyline is represented by a N-by-2 array, each
     row of the array representing the coordinates of a vertex.  Simple
     polygons are assumed to be closed, so there is no need to repeat
     the first vertex at the end.  As both polygons and polylines can be
     represented by a list of vertex coordinates, some functions also
     consider the vertex list itself.  Such functions are prefixed by
     'pointSet'.  Also, many functions prefixed by 'polygon' or
     'polyline' works also on the other type of shape.

     For multiple-connected polygons, the different connected boundaries
     are separated by a row [NaN NaN].

     For some functions, the orientation of the polygon can be relevant:
     CCW stands for 'Conter-Clockwise' (positive orientation), CW stands
     for 'Clockwise'.

     Polylines are parametrized in the following way: * the i-th vertex
     is located at position i-1 * points of the i-th edge have positions
     ranging linearly from i-1 to i The parametrization domain for an
     open polyline is from 0 to Nv-1, and from 0 to Nv for a closed
     polyline (positions 0 and Nv correspond to the same point).

     Example: # Simple polygon: P1 = [1 1;2 1;2 2;1 2]; drawPolygon(P1);
     axis([0 5 0 5]); # Multiple polygon: P2 = [10 10;40 10;40 40;10
     40;NaN NaN;20 20;20 30;30 30;30 20]; figure;drawPolygon(P2);
     axis([0 50 0 50]);

     Point Sets pointSetBounds - Bounding box of a set of points
     pointSetsAverage - Compute the average of several point sets
     minimumCaliperDiameter - Minimum caliper diameter of a set of
     points findPoint - Find index of a point in an set from its
     coordinates

     Polylines polylinePoint - Extract a point from a polyline
     polylineLength - Return length of a polyline given as a list of
     points polylineCentroid - Compute centroid of a curve defined by a
     series of points polylineSubcurve - Extract a portion of a polyline
     reversePolyline - Reverse a polyline, by iterating vertices from
     the end isPointOnPolyline - Test if a point belongs to a polyline
     projPointOnPolyline - Compute position of a point projected on a
     polyline distancePointPolyline - Compute shortest distance between
     a point and a polyline distancePolylines - Compute the shortest
     distance between 2 polylines intersectPolylines - Find the common
     points between 2 polylines polylineSelfIntersections - Find
     self-intersections points of a polyline

     Curves (polylines with lot of vertices) parametrize -
     Parametrization of a curve, based on edges length curvature -
     Estimate curvature of a polyline defined by points cart2geod -
     Convert cartesian coordinates to geodesic coord.  geod2cart -
     Convert geodesic coordinates to cartesian coord.  curveMoment -
     Compute inertia moment of a 2D curve curveCMoment - Compute
     centered inertia moment of a 2D curve curveCSMoment - Compute
     centered scaled moment of a 2D curve

     Polygons polygonPoint - Extract a point from a polygon
     polygonSubcurve - Extract a portion of a polygon reversePolygon -
     Reverse a polygon, by iterating vertices from the end
     projPointOnPolygon - Compute position of a point projected on a
     polygon splitPolygons - Convert a NaN separated polygon list to a
     cell array of polygons clipPolygon - Clip a polygon with a
     rectangular box clipPolygonHP - Clip a polygon with a Half-plane
     defined by a directed line intersectLinePolygon - Intersection
     points between a line and a polygon intersectRayPolygon -
     Intersection points between a ray and a polygon
     polygonSelfIntersections - Find-self intersection points of a
     polygon convexHull - Convex hull of a set of points polygonLoops -
     Divide a possibly self-intersecting polygon into a set of simple
     loops expandPolygon - Expand a polygon by a given (signed) distance
     medialAxisConvex - Compute medial axis of a convex polygon

     Measures on Polygons isPointInPolygon - Test if a point is located
     inside a polygon polygonContains - Test if a point is contained in
     a multiply connected polygon polygonCentroid - Compute the centroid
     (center of mass) of a polygon polygonArea - Compute the signed area
     of a polygon polygonLength - Perimeter of a polygon
     polygonNormalAngle - Compute the normal angle at a vertex of the
     polygon polygonBounds - Compute the bounding box of a polygon
     distancePointPolygon - Compute shortest distance between a point
     and a polygon distancePolygons - Compute the shortest distance
     between 2 polygons

     Triangles isPointInTriangle - Test if a point is located inside a
     triangle triangleArea - Area of a triangle

     Functions from stochastic geometry steinerPoint - Compute steiner
     point (weighted centroid) of a polygon steinerPolygon - Create a
     Steiner polygon from a set of vectors supportFunction - Compute
     support function of a polygon convexification - Compute the
     convexification of a polygon

     Input, Output and conversions readPolygon - Read a polygon stored
     in a file polygonToRow - Convert polygon coordinates to a row
     vector rowToPolygon - Create a polygon from a row vector
     rectAsPolygon - Convert a (centered) rectangle into a series of
     points

     Drawing functions drawPolyline - Draw a polyline specified by a
     list of points drawPolygon - Draw a polygon specified by a list of
     points fillPolygon - Fill a polygon specified by a list of points

     Credits: * function intersectPolylines uses the 'interX'
     contribution from "NS" (file exchange 22441, called
     'curve-intersections')

     --- Author: David Legland e-mail: david.legland@grignon.inra.fr
     created the 07/11/2005.  Homepage:
     <http://matgeom.sourceforge.net/>
     <http://www.pfl-cepia.inra.fr/index.php?page=geom2d> Copyright INRA
     - Cepia Software Platform.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Description of functions operating on 2D polygons



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
polylineSelfIntersections


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1075
 -- Function File: PTS = polylineSelfIntersections (POLY)
 -- Function File: PTS = polylineSelfIntersections
          (POLY,'tolerance',TOL)
     Find self-intersections points of a polyline

     Return the position of self intersection points

     Also return the 2 positions of each intersection point (the
     position when meeting point for first time, then position when
     meeting point for the second time).

     Specifies an additional tolerance parameter to decide whether two
     intersection points should be considered the same, based on their
     euclidean distance.

     Example
                # use a gamma-shaped polyline
                poly = [0 0;0 10;20 10;20 20;10 20;10 0];
                polylineSelfIntersections(poly)
                ans =
                    10 10

                # use a 'S'-shaped polyline
                poly = [10 0;0 0;0 10;20 10;20 20;10 20];
                polylineSelfIntersections(poly)
                ans =
                    10 10

     See also: polygons2d, intersectPolylines, polygonSelfIntersections.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Find self-intersections points of a polyline



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
projPointOnPolyline


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1325
 -- Function File: [P, D] = projPointOnPolyline (POINT, POLY)
 -- Function File: [...] = projPointOnPolyline (..., CLOSED)

     Compute the position of the orthogonal projection of a point on a
     polyline.

     POINT is a 1x2 row vector containing point coordinates POLY is a
     Nx2 array containing coordinates of polyline vertices POS is the
     position of the point on the polyline, between 0 and the number of
     vertices of the polyline.  POS can be a non-integer value, in this
     case, the integer part correspond to the polyline edge index
     (between 0 and N-1), and the floating-point part correspond to the
     relative position on i-th edge (between 0 and 1, 0: edge start, 1:
     edge end).

     When POINT is an array of points, returns a column vector with as
     many rows as the number of points.

     If third input argument CLOSED is given, it specifies if the
     polyline is closed or not.  CLOSED can be one of:
     'closed'
          The polyline is closed

     'open'
          The polyline is open

     a logical column vector
          It should have the same number of elements as the number of
          points and it specifies individually if each polyline is
          closed (true=closed).

     See also: points2d, polygons2d, polylinePoint,
     distancePointPolyline.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
Compute the position of the orthogonal projection of a point on a
polyline.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
rectAsPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 439
 -- Function File: P = rectAsPolygon (RECT)
 -- Function File: [X, Y] = rectAsPolygon (RECT)
     Convert a (centered) rectangle into a series of points

     Converts rectangle given as [x0 y0 w h] or [x0 y0 w h theta] into a
     4*2 array double, containing coordinate of rectangle vertices.
     with two output arguments the coordinates are splitted in X and Y.

     See also: polygons2d, drawRect, drawRect2, drawPolygon, drawShape.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Convert a (centered) rectangle into a series of points



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
reversePolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 294
 -- Function File: POLY2 = reversePolygon (POLY)
     Reverse a polygon, by iterating vertices from the end

     POLY2 = reversePolygon(POLY) POLY2 has same vertices as POLY, but
     in different order.  The first vertex of the polygon is still the
     same.

     See also: reversePolyline.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Reverse a polygon, by iterating vertices from the end



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
reversePolyline


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 262
 -- Function File: POLY2 = reversePolyline (POLY)
     Reverse a polyline, by iterating vertices from the end

     POLY2 = reversePolyline(POLY) POLY2 has same vertices as POLY, but
     POLY2(i,:) is the same as POLY(END-i+1,:).

     See also: reversePolygon.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Reverse a polyline, by iterating vertices from the end



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
simplifyPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 228
 -- Function File: SPOLY = simplifyPolygon (POLY)
     Simplify a polygon using the Ramer-Douglas-Peucker algorithm.

     POLY is a N-by-2 matrix, each row representing a vertex.

     See also: simplifyPolyline, shape2polygon.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Simplify a polygon using the Ramer-Douglas-Peucker algorithm.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
simplifyPolyline


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 899
 -- [PLINE2 IDX] = simplifyPolyline (PLINE)
 -- ... = simplifyPolyline (...,PROPERTY,VALUE,...)
     Simplify or subsample a polyline using the Ramer-Douglas-Peucker
     algorithm, a.k.a.  the iterative end-point fit algorithm or the
     split-and-merge algorithm.

     The PLINE as a N-by-2 matrix.  Rows correspond to the verices
     (compatible with 'polygons2d').  The vector IDX constains the
     indexes on vetices in PLINE that generates PLINE2, i.e.  'pline2 =
     pline(idx,:)'.

     *Parameters*
     ''Nmax''
          Maximum number of vertices.  Default value '1e3'.
     ''Tol''
          Tolerance for the error criteria.  Default value '1e-4'.
     ''MaxIter''
          Maximum number of iterations.  Default value '10'.
     ''Method''
          Not implemented.

     Run 'demo simplifyPolyline' to see an example.

     See also: curve2polyline, curveval, simplifyPolygon.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Simplify or subsample a polyline using the Ramer-Douglas-Peucker
algorithm, a...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
splitPolygons


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 345
 -- Function File: POLYGONS = splitPolygons (POLYGON)
     Convert a NaN separated polygon list to a cell array of polygons.

     POLYGON is a N-by-M array of points, with possibly couples of NaN
     values.  The functions separates each component separated by NaN
     values, and returns a cell array of polygons.

     See also: polygons2d.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Convert a NaN separated polygon list to a cell array of polygons.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
supportFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 509
 -- Function File: H = suppportFunction (POLYGON)
 -- Function File: H = suppportFunction (POLYGON, N)
 -- Function File: H = suppportFunction (POLYGON, V)
     Compute support function of a polygon

     H = supportFunction(POLYGON, N) uses N points for suport function
     approximation

     H = supportFunction(POLYGON) assume 24 points for approximation

     H = supportFunction(POLYGON, V) where V is a vector, uses vector V
     of angles to compute support function.

     See also: convexification.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Compute support function of a polygon





