# doc-cache created by Octave 6.4.0
# name: cache
# type: cell
# rows: 3
# columns: 141
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
Contents


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11556
 GEOM2D Geometry 2D Toolbox
 Version 1.24 07-Jun-2018 .

 	Library to handle and visualize geometric primitives such as points,
 	lines, circles and ellipses, polygons...

   The goal is to provide a low-level library for manipulating geometrical
   primitives, making easier the development of more complex geometric
   algorithms. 

   Most functions works for planar shapes, but some ones have been
   extended to 3D or to any dimension.

 Points
   points2d                 - Description of functions operating on points.
   midPoint                 - Middle point of two points or of an edge.
   circumCenter             - Circumcenter of three points.
   isCounterClockwise       - Compute the relative orientation of 3 points.
   polarPoint               - Create a point from polar coordinates (rho + theta).
   angle2Points             - Compute horizontal angle between 2 points.
   angle3Points             - Compute oriented angle made by 3 points.
   distancePoints           - Compute distance between two points.
   transformPoint           - Apply an affine transform to a point or a point set.
   drawPoint                - Draw the point on the axis.

 Point Sets
   clipPoints               - Clip a set of points by a box.
   centroid                 - Compute centroid (center of mass) of a set of points.
   boundingBox              - Bounding box of a set of points.
   principalAxes            - Principal axes of a set of ND points.
   angleSort                - Sort points in the plane according to their angle to origin.
   findClosestPoint         - Find index of closest point in an array.
   minDistancePoints        - Minimal distance between several points.
   mergeClosePoints         - Merge points that are closer than a given distance.
   hausdorffDistance        - Hausdorff distance between two point sets.
   nndist                   - Nearest-neighbor distances of each point in a set.

 Vectors
   vectors2d                - Description of functions operating on plane vectors.
   createVector             - Create a vector from two points.
   vectorNorm               - Compute norm of a vector, or of a set of vectors.
   vectorAngle              - Horizontal angle of a vector, or angle between 2 vectors.
   normalizeVector          - Normalize a vector to have norm equal to 1.
   isPerpendicular          - Check orthogonality of two vectors.
   isParallel               - Check parallelism of two vectors.
   transformVector          - Transform a vector with an affine transform.
   rotateVector             - Rotate a vector by a given angle.

 Straight lines
   lines2d                  - Description of functions operating on planar lines.
   createLine               - Create a straight line from 2 points, or from other inputs.
   medianLine               - Create a median line between two points.
   cartesianLine            - Create a straight line from cartesian equation coefficients.
   orthogonalLine           - Create a line orthogonal to another one through a point.
   parallelLine             - Create a line parallel to another one.
   intersectLines           - Return all intersection points of N lines in 2D.
   lineAngle                - Computes angle between two straight lines.
   linePosition             - Position of a point on a line.
   lineFit                  - Fit a straight line to a set of points.
   clipLine                 - Clip a line with a box.
   reverseLine              - Return same line but with opposite orientation.
   transformLine            - Transform a line with an affine transform.
   lineToEdge               - Convert a straight line to a finite edge.
   drawLine                 - Draw a straight line clipped by the current axis.

 Edges (line segments between 2 points)
   edges2d                  - Description of functions operating on planar edges.
   createEdge               - Create an edge between two points, or from a line.
   edgeAngle                - Return angle of edge.
   edgeLength               - Return length of an edge.
   parallelEdge             - Edge parallel to another edge.
   centeredEdgeToEdge       - Convert a centered edge to a two-points edge.
   midPoint                 - Middle point of two points or of an edge.
   edgePosition             - Return position of a point on an edge.
   clipEdge                 - Clip an edge with a rectangular box.
   reverseEdge              - Intervert the source and target vertices of edge.
   intersectEdges           - Return all intersections between two set of edges.
   intersectLineEdge        - Return intersection between a line and an edge.
   transformEdge            - Transform an edge with an affine transform.
   edgeToLine               - Convert an edge to a straight line.
   edgeToPolyline           - Convert an edge to a polyline with a given number of segments.
   drawEdge                 - Draw an edge given by 2 points.
   drawCenteredEdge         - Draw an edge centered on a point.

 Rays
   rays2d                   - Description of functions operating on planar rays.
   createRay                - Create a ray (half-line), from various inputs.
   bisector                 - Return the bisector of two lines, or 3 points.
   clipRay                  - Clip a ray with a box.
   drawRay                  - Draw a ray on the current axis.

 Relations between points and lines
   distancePointEdge        - Minimum distance between a point and an edge.
   distancePointLine        - Minimum distance between a point and a line.
   projPointOnLine          - Project of a point orthogonally onto a line.
   pointOnLine              - Create a point on a line at a given position on the line.
   isPointOnLine            - Test if a point belongs to a line.
   isPointOnEdge            - Test if a point belongs to an edge.
   isPointOnRay             - Test if a point belongs to a ray.
   isLeftOriented           - Test if a point is on the left side of a line.

 Circles
   circles2d                - Description of functions operating on circles.
   createCircle             - Create a circle from 2 or 3 points.
   createDirectedCircle     - Create a directed circle.
   intersectCircles         - Intersection points of two circles.
   intersectLineCircle      - Intersection point(s) of a line and a circle.
   circleToPolygon          - Convert a circle into a series of points.
   circleArcToPolyline      - Convert a circle arc into a series of points.
   isPointInCircle          - Test if a point is located inside a given circle.
   isPointOnCircle          - Test if a point is located on a given circle.
   enclosingCircle          - Find the minimum circle enclosing a set of points.
   circumCircle             - Circumscribed circle of three points.
   radicalAxis              - Compute the radical axis (or radical line) of 2 circles.
   drawCircle               - Draw a circle on the current axis.
   drawCircleArc            - Draw a circle arc on the current axis.

 Ellipses and Parabola
   ellipses2d               - Description of functions operating on ellipses.
   equivalentEllipse        - Equivalent ellipse of a set of points.
   isPointInEllipse         - Check if a point is located inside a given ellipse.
   ellipsePerimeter         - Perimeter of an ellipse.
   ellipseToPolygon         - Convert an ellipse into a series of points.
   drawEllipse              - Draw an ellipse on the current axis.
   drawEllipseArc           - Draw an ellipse arc on the current axis.
   drawParabola             - Draw a parabola on the current axis.

 Geometric transforms
   transforms2d             - Description of functions operating on transforms.
   createTranslation        - Create the 3*3 matrix of a translation.
   createRotation           - Create the 3*3 matrix of a rotation.
   createRotation90         - Matrix of a rotation for 90 degrees multiples.
   createScaling            - Create the 3*3 matrix of a scaling in 2 dimensions.
   createHomothecy          - Create the the 3x3 matrix of an homothetic transform.
   createBasisTransform     - Compute matrix for transforming a basis into another basis.
   createLineReflection     - Create the the 3x3 matrix of a line reflection.
   principalAxesTransform   - Align a set of points along its principal axes.
   fitAffineTransform2d     - Compute the affine transform that best register two point sets.
   registerICP              - Fit affine transform by Iterative Closest Point algorithm.
   polynomialTransform2d    - Apply a polynomial transform to a set of points.
   fitPolynomialTransform2d - Coefficients of polynomial transform between two point sets.

 Angles
   angles2d                 - Description of functions for manipulating angles.
   normalizeAngle           - Normalize an angle value within a 2*PI interval.
   angleAbsDiff             - Absolute difference between two angles.
   angleDiff                - Difference between two angles.

 Boxes
   boxes2d                  - Description of functions operating on bounding boxes.
   intersectBoxes           - Intersection of two bounding boxes.
   mergeBoxes               - Merge two boxes, by computing their greatest extent.
   randomPointInBox         - Generate random point within a box.
   boxToRect                - Convert box data to rectangle data.
   boxToPolygon             - Convert a bounding box to a square polygon.
   drawBox                  - Draw a box defined by coordinate extents.

 Triangles
   isPointInTriangle        - Test if a point is located inside a triangle.
   triangleArea             - Signed area of a triangle.

 Rectangles
   rectToPolygon            - Convert a rectangle into a polygon (set of vertices).
   rectToBox                - Convert rectangle data to box data.
   drawRect                 - Draw rectangle on the current axis.
   orientedBox              - Minimum-width oriented bounding box of a set of points.
   orientedBoxToPolygon     - Convert an oriented box to a polygon (set of vertices).
   drawOrientedBox          - Draw centered oriented rectangle.

 Splines
   cubicBezierToPolyline    - Compute equivalent polyline from bezier curve control.
   drawBezierCurve          - Draw a cubic bezier curve defined by 4 control points.

 Various drawing functions
   drawVector               - Draw vector at a given position.
   drawArrow                - Draw an arrow on the current axis.
   drawLabels               - Draw labels at specified positions.
   drawShape                - Draw various types of shapes (circles, polygons...).

 Other shapes
   squareGrid               - Generate equally spaces points in plane.
   hexagonalGrid            - Generate hexagonal grid of points in the plane.
   triangleGrid             - Generate triangular grid of points in the plane.
   crackPattern             - Create a (bounded) crack pattern tessellation.
   crackPattern2            - Create a (bounded) crack pattern tessellation.


   Credits:
   * function 'enclosingCircle' rewritten from a file from Yazan Ahed
       (yash78@gmail.com), available on Matlab File Exchange

 -----
 Author: David Legland
 e-mail: david.legland@inrae.fr
 Created: 2005-11-07
 Copyright INRA - Cepia Software Platform.
 Project homepage: http://github.com/mattools/matGeom
 http://www.pfl-cepia.inra.fr/index.php?page=geom2d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
 GEOM2D Geometry 2D Toolbox
 Version 1.24 07-Jun-2018 .



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 547
ANGLE2POINTS Compute horizontal angle between 2 points.

   ALPHA = angle2Points(P1, P2),
   Pi are either [1*2] arrays, or [N*2] arrays, in this case ALPHA is a 
   [N*1] array. The angle computed is the horizontal angle of the line 
   (P1 P2)
   Result is always given in radians, between 0 and 2*pi.

   See Also:
   points2d, angles2d, angle3points, normalizeAngle, vectorAngle


 ---------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 created the 02/03/2007.
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
ANGLE2POINTS Compute horizontal angle between 2 points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 594
ANGLE3POINTS Compute oriented angle made by 3 points.

   ALPHA = angle3Points(P1, P2, P3);
   Computes the angle between the points P1, P2 and P3.
   Pi are either [1*2] arrays, or [N*2] arrays, in this case ALPHA is a 
   [N*1] array. The angle computed is the directed angle between line 
   (P2P1) and line (P2P3).
   Result is always given in radians, between 0 and 2*pi.

   See Also:
   points2d, angles2d, angle2points


   ---------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 created the 23/02/2004.
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
ANGLE3POINTS Compute oriented angle made by 3 points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 531
ANGLEABSDIFF Absolute difference between two angles.

   AD = angleAbsDiff(ANGLE1, ANGLE2)
   Computes the absolute angular difference between two angles in radians.
   The result is comprised between 0 and PI.

   Example
     A = angleAbsDiff(pi/2, pi/3)
     A = 
         0.5236   % equal to pi/6

   See also
   angles2d, angleDiff

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
ANGLEABSDIFF Absolute difference between two angles.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 565
ANGLEDIFF Difference between two angles.

   Computes the signed angular difference between two angles in radians.
   The result is comprised between -PI and +PI.

   Example
     A = angleDiff(-pi/4, pi/4)
     A = 
         1.5708    % equal to pi/2
     A = angleDiff(pi/4, -pi/4)
     A = 
        -1.5708    % equal to -pi/2

   See also
   angles2d, angleAbsDiff

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ANGLEDIFF Difference between two angles.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 856
ANGLESORT Sort points in the plane according to their angle to origin.


   PTS2 = angleSort(PTS);
   Computes angle of points with origin, and sort points with increasing
   angles in Counter-Clockwise direction.

   PTS2 = angleSort(PTS, PTS0);
   Computes angles between each point of PTS and PT0, which can be
   different from origin.

   PTS2 = angleSort(..., THETA0);
   Specifies the starting angle for sorting.

   [PTS2, I] = angleSort(...);
   Also returns in I the indices of PTS, such that PTS2 = PTS(I, :);

   [PTS2, I, ANGLES] = angleSort(...);
   Also returns the ANGLES in corresponding order to PTS2.

   See Also:
   points2d, angles2d, angle2points, normalizeAngle


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2005-11-24
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
ANGLESORT Sort points in the plane according to their angle to origin.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
angles2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 562
 Description of functions for manipulating angles.

   Angles are normalized in an interval of width 2*PI. Most geom2d
   functions return results in the [0 2*pi] interval, but it can be
   convenient to consider the [-pi pi] interval as well. See the
   normalizeAngle function to switch between conventions.

   Angles are usually oriented. The default orientation is the CCW
   (Counter-Clockwise) orientation.

   See also:
   normalizeAngle, angleDiff, angleAbsDiff, angleSort
   angle2Points, angle3Points, vectorAngle, lineAngle, edgeAngle




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
 Description of functions for manipulating angles.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
bisector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 599
BISECTOR Return the bisector of two lines, or 3 points.

   RAY = bisector(LINE1, LINE2);
   create the bisector of the two lines, given as [x0 y0 dx dy].

   RAY = bisector(P1, P2, P3);
   create the bisector of lines (P2 P1) and (P2 P3).

   The result has the form [x0 y0 dx dy], with [x0 y0] being the origin
   point ans [dx dy] being the direction vector, normalized to have unit
   norm.
   
   See also:
   lines2d, rays2d

   ---------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 created the 31/10/2003.
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
BISECTOR Return the bisector of two lines, or 3 points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 860
BOUNDINGBOX Bounding box of a set of points.

   BOX = boundingBox(POINTS)
   Returns the bounding box of the set of points POINTS. POINTS can be
   either a N-by-2 or N-by-3 array. The result BOX is a 1-by-4 or 1-by-6
   array, containing:
   [XMIN XMAX YMIN YMAX] (2D point sets)
   [XMIN XMAX YMIN YMAX ZMIN ZMAX] (3D point sets)

   Example
   % Draw the bounding box of a set of random points
     points = rand(30, 2);
     figure; hold on;
     drawPoint(points, '.');
     box = boundingBox(points);
     drawBox(box, 'r');

   % Draw bounding box of a cubeoctehedron
     [v e f] = createCubeOctahedron;
     box3d = boundingBox(v);
     figure; hold on;
     drawMesh(v, f);
     drawBox3d(box3d);
     set(gcf, 'renderer', 'opengl')
     axis([-2 2 -2 2 -2 2]);
     view(3)
     
   See also
   polygonBounds, drawBox




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
BOUNDINGBOX Bounding box of a set of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 459
BOXTOPOLYGON Convert a bounding box to a square polygon.

   poly = boxToPolygon(box)
   Utility function that convert box data in [XMIN XMAX YMIN YMAX] format
   to polygon data corresponding to the box boundary. The resulting POLY
   is a 4-by-2 array.


   Example
     box = [ 10 50 20 40];
     poly = boxToPolygon(box)
     poly = 
         10    20
         50    20
         50    40
         10    40

   See also
     boxes2d, polygons2d, boxToRect



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
BOXTOPOLYGON Convert a bounding box to a square polygon.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 303
BOXTORECT Convert box data to rectangle data.

   RECT = boxToRect(BOX)
   Converts from boxrepresentation to rectangle representation.
   BOX is given by [XMIN XMAX YMIN YMAX].
   RECT is given by [X0 Y0 WIDTH HEIGHT], with WIDTH and HEIGHT > 0

   See also
   boxes2d, boxToPolygon, drawBox




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
BOXTORECT Convert box data to rectangle data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
boxes2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 398
BOXES2D Description of functions operating on bounding boxes.

   A box is represented as a set of limits in each direction:
   BOX = [XMIN XMAX YMIN YMAX].

   Boxes are used as result of computation for bounding boxes, and to clip
   shapes.

   See also
   boundingBox, clipPoints, clipLine, clipEdge, clipRay
   mergeBoxes, intersectBoxes, randomPointInBox, boxToRect, boxToPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
BOXES2D Description of functions operating on bounding boxes.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 379
CARTESIANLINE Create a straight line from cartesian equation coefficients.

   L = cartesianLine(A, B, C);
   Create a line verifying the Cartesian equation:
   A*x + B*x + C = 0;

   See also:
   lines2d, createLine

   ---------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 created the 25/05/2004.
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
CARTESIANLINE Create a straight line from cartesian equation coefficients.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 662
CENTEREDEDGETOEDGE Convert a centered edge to a two-points edge.

   EDGE = centeredEdgeToEdge(CEDGE)
   Converts an edge represented using center, length and orientation to an
   edge represented using coordinates of end points.

   Example
     % example of conversion on a 'pythagorean' edge
     cedge = [30 40 50 atand(3/4)];
     centeredEdgeToEdge(cedge)
     ans =
         10    25    50    55


   See also
     edges2d, drawCenteredEdge, drawOrientedBox

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
CENTEREDEDGETOEDGE Convert a centered edge to a two-points edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
centroid


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 987
CENTROID Compute centroid (center of mass) of a set of points.

   PTS = centroid(POINTS)
   PTS = centroid(PTX, PTY)
   Computes the ND-dimensional centroid of a set of points. 
   POINTS is an array with as many rows as the number of points, and as
   many columns as the number of dimensions. 
   PTX and PTY are two column vectors containing coordinates of the
   2-dimensional points.
   The result PTS is a row vector with Nd columns.

   PTS = centroid(POINTS, MASS)
   PTS = centroid(PTX, PTY, MASS)
   Computes center of mass of POINTS, weighted by coefficient MASS.
   POINTS is a Np-by-Nd array, MASS is Np-by-1 array, and PTX and PTY are
   also both Np-by-1 arrays.

   Example:
   pts = [2 2;6 1;6 5;2 4];
   centroid(pts)
   ans =
        4     3

   See Also:
   points2d, polygonCentroid
   
 ---------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 created the 07/04/2003.
 Copyright 2010 INRA - Cepia Software Platform.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
CENTROID Compute centroid (center of mass) of a set of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 858
CIRCLEARCTOPOLYLINE Convert a circle arc into a series of points.

   P = circleArcToPolyline(ARC, N);
   convert the circle ARC into a series of N points. 
   ARC is given in the format: [XC YC R THETA1 DTHETA]
   where XC and YC define the center of the circle, R its radius, THETA1
   is the start of the arc and DTHETA is the angle extent of the arc. Both
   angles are given in degrees. 
   N is the number of vertices of the resulting polyline, default is 65.

   The result is a N-by-2 array containing coordinates of the N points. 

   [X Y] = circleArcToPolyline(ARC, N);
   Return the result in two separate arrays with N lines and 1 column.


   See also:
   circles2d, circleToPolygon, drawCircle, drawPolygon


 ---------
 author : David Legland 
 created the 22/05/2006.
 Copyright 2010 INRA - Cepia Software Platform.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
CIRCLEARCTOPOLYLINE Convert a circle arc into a series of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 647
CIRCLETOPOLYGON Convert a circle into a series of points.

   PTS = circleToPolygon(CIRC, N);
   Converts the circle CIRC into an array of  N-by-2 of double, containing
   x and y positions of vertices. 
   CIRC is given as [x0 y0 r], where x0 and y0 are coordinate of center,
   and r is the radius. 

   P = circleToPolygon(CIRCLE);
   uses a default value of N=64 vertices.

   Example
     poly = circleToPolygon([30 20 15], 16);
     figure; hold on;
     axis equal;axis([0 50 0 50]);
     drawPolygon(poly, 'b');
     drawPoint(poly, 'bo');

   See also:
   circles2d, polygons2d, circleArcToPolyline, ellipseToPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
CIRCLETOPOLYGON Convert a circle into a series of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1081
CIRCLES2D Description of functions operating on circles.

   Circles are represented by their center and their radius:
   C = [xc yc r];
   One sometimes considers orientation of circle, by adding an extra
   boolean value in 4-th position, with value TRUE for direct (i.e.
   turning Counter-clockwise) circles.

   Circle arcs are represented by their center, their radius, the starting
   angle and the angle extent, both in degrees:
   CA = [xc yc r theta0 dtheta];
   
   Ellipses are represented by their center, their 2 semi-axis length, and
   their angle (in degrees) with Ox direction.
   E = [xc yc A B theta];

   See also:
   ellipses2d, createCircle, createDirectedCircle, 
   isPointInCircle, isPointOnCircle, enclosingCircle, circumCircle
   intersectLineCircle, intersectCircles, radicalAxis
   circleToPolygon, circleArcToPolyline
   drawCircle, drawCircleArc

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2008-10-13,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
CIRCLES2D Description of functions operating on circles.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 429
CIRCUMCENTER  Circumcenter of three points.

   CC = circumCenter(P1, P2, P3)

   Example
     A = [10 10]; B = [30 10]; C = [10 20];
     circumCenter(A, B, C)
     ans =
         20    15

     % works also for multiple input points
     circumCenter([A;A;A], [B;B;B], [C;C;C])
     ans =
         20    15
         20    15
         20    15


   See also
     points2d, circles2d, circumCircle, centroid




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CIRCUMCENTER  Circumcenter of three points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 429
CIRCUMCIRCLE Circumscribed circle of three points.

   CIRC = circumCircle(TRI)
   CIRC = circumCircle(P1, P2, P3)
   Compute circumcircle of a triangle given by 3 points.

   Example
     T = [10 20; 70 20; 30 70];
     C = circumCircle(T);
     figure; drawPolygon(T, 'linewidth', 2);
     hold on; drawCircle(C);
     axis equal; axis([0 100 0 100]);

   See also
     circles2d, enclosingCircle, circumCenter




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
CIRCUMCIRCLE Circumscribed circle of three points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
clipEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 386
CLIPEDGE Clip an edge with a rectangular box.

   EDGE2 = clipEdge(EDGE, BOX);
   EDGE: [x1 y1 x2 y2],
   BOX : [xmin xmax ymin ymax], or [xmin xmax ; ymin ymax].
   return :
   EDGE2 = [xc1 yc1 xc2 yc2];

   If clipping is null, return [0 0 0 0];

   if EDGE is a N-by-4 array, return an N-by-4 array, corresponding to
   each clipped edge.

   See also
   edges2d, boxes2d, clipLine




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CLIPEDGE Clip an edge with a rectangular box.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
clipLine


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 869
CLIPLINE Clip a line with a box.

   EDGE = clipLine(LINE, BOX);
   LINE is a straight line given as a 4 element row vector: [x0 y0 dx dy],
   with (x0 y0) being a point of the line and (dx dy) a direction vector,
   BOX is the clipping box, given by its extreme coordinates: 
   [xmin xmax ymin ymax].
   The result is given as an edge, defined by the coordinates of its 2
   extreme points: [x1 y1 x2 y2].
   If line does not intersect the box, [NaN NaN NaN NaN] is returned.
   
   Function works also if LINE is a N-by-4 array, if BOX is a Nx4 array,
   or if both LINE and BOX are N-by-4 arrays. In these cases, EDGE is a
   N-by-4 array.
   

   Example
   line = [30 40 10 0];
   box = [0 100 0 100];
   res = clipLine(line, box)
   res = 
       0 40 100 40

   See also:
   lines2d, boxes2d, edges2d
   clipEdge, clipRay, clipLine3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CLIPLINE Clip a line with a box.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 395
CLIPPOINTS Clip a set of points by a box.

   CLIP = clipPoints(POINTS, BOX);
   Returns the set of points which are located inside of the box BOX.


   See also
   points2d, boxes2d, clipLine, drawPoint


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2008-10-13,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CLIPPOINTS Clip a set of points by a box.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
clipRay


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 724
 Clip a ray with a box.

   EDGE = clipRay(RAY, BOX);
   RAY is a straight ray given as a 4 element row vector: [x0 y0 dx dy],
   with (x0 y0) being the origin of the ray and (dx dy) its direction
   vector, BOX is the clipping box, given by its extreme coordinates: 
   [xmin xmax ymin ymax].
   The result is given as an edge, defined by the coordinates of its 2
   extreme points: [x1 y1 x2 y2].
   If the ray does not intersect the box, [NaN NaN NaN NaN] is returned.
   
   Function works also if RAY is a N-by-4 array, if BOX is a Nx4 array, or
   if both RAY and BOX are N-by-4 arrays. In these cases, EDGE is a N-by-4
   array.
      
   See also:
     rays2d, boxes2d, edges2d, clipLine, drawRay




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
 Clip a ray with a box.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 763
CRACKPATTERN Create a (bounded) crack pattern tessellation.

   E = crackPattern(BOX, POINTS, ALPHA)
   create a crack propagation pattern wit following parameters :
   - pattern is bounded by area BOX given by [xmin xmax ymin ymax].
   - each crack originates from points given in POINTS
   - direction of each crack is given by array ALPHA
   - a crack stop when it reaches another already created crack. 
   - all cracks stop when they reach the border of the frame, given by box
   (a serie of 4 points).
   The result is a collection of edges, in the form [x1 y1 x2 y2].

   E = crackPattern(BOX, POINTS, ALPHA, SPEED)
   Also specify speed of propagation of each crack.


   See the result with :
     figure;
     drawEdge(E);

   See also 
     drawEdge




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
CRACKPATTERN Create a (bounded) crack pattern tessellation.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 919
CRACKPATTERN2 Create a (bounded) crack pattern tessellation.

   E = crackPattern2(BOX, POINTS, ALPHA)
   create a crack propagation pattern wit following parameters :
   - pattern is bounded by area BOX which is a polygon.
   - each crack originates from points given in POINTS
   - directions of each crack is given by a [NxM] array ALPHA, where M is
   the number of rays emanating from each seed/
   - a crack stop when it reaches another already created crack. 
   - all cracks stop when they reach the border of the frame, given by box
   (a serie of 4 points).
   The result is a collection of edges, in the form [x1 y1 x2 y2].

   E = crackPattern2(BOX, POINTS, ALPHA, SPEED)
   Also specify speed of propagation of each crack.


   See the result with :
     figure;
     drawEdge(E);

   See also drawEdge

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 25/05/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
CRACKPATTERN2 Create a (bounded) crack pattern tessellation.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1693
CREATEBASISTRANSFORM Compute matrix for transforming a basis into another basis.

   TRANSFO = createBasisTransform(SOURCE, TARGET)
   Both SOURCE and TARGET represent basis, in the following form:
   [x0 y0  ex1 ey1  ex2 ey2]
   [y0 y0] is the origin of the basis, [ex1 ey1] is the first direction
   vector, and [ex2 ey2] is the second direction vector.

   The result TRANSFO is a 3-by-3 matrix such that a point expressed with
   coordinates of the first basis will be represented by new coordinates
   P2 = transformPoint(P1, TRANSFO) in the target basis.
   
   TRANSFO = createBasisTransform(TARGET)
   Assumes the source is the standard (Oij) basis, with origin at (0,0),
   first direction vector equal to (1,0) and second direction  vector
   equal to (0,1).


   Example
     % define source and target bases
     src = [ 0 0   1  0    0  1];
     tgt = [20 0  .5 .5  -.5 .5];
     trans = createBasisTransform(src, tgt);
     % create a polygon in source basis
     poly = [10 10;30 10; 30 20; 20 20;20 40; 10 40];
     figure;
     subplot(121); drawPolygon(poly, 'b'); axis equal; axis([-10 50 -10 50]);
     hold on; drawLine([0 0 1 0], 'k'); drawLine([0 0 0 1], 'k');
     drawLine([20 0 1 1], 'r'); drawLine([20 0 -1 1], 'r');
     t = -1:5; plot(t*5+20, t*5, 'r.'); plot(-t*5+20, t*5, 'r.');
     % transform the polygon in target basis
     poly2 = transformPoint(poly, trans);
     subplot(122); drawPolygon(poly2, 'b'); axis equal; axis([-10 50 -10 50]);
     hold on; drawLine([0 0 1 0], 'r'); drawLine([0 0 0 1], 'r');
     t = -1:5; plot(t*10, zeros(size(t)), 'r.'); plot(zeros(size(t)), t*10, 'r.');

   See also
   transforms2d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
CREATEBASISTRANSFORM Compute matrix for transforming a basis into another bas...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 854
CREATECIRCLE Create a circle from 2 or 3 points.

   C = createCircle(P1, P2, P3);
   Creates the circle passing through the 3 given points. 
   C is a 1*3 array of the form: [XC YX R].

   C = createCircle(P1, P2);
   Creates the circle whith center P1 and passing throuh the point P2.

   Works also when input are point arrays the same size, in this case the
   result has as many lines as the point arrays.

   Example
   % Draw a circle passing through 3 points.
     p1 = [10 15];
     p2 = [15 20];
     p3 = [10 25];
     circle = createCircle(p1, p2, p3);
     figure; hold on; axis equal; axis([0 50 0 50]);
     drawPoint([p1 ; p2; p3]);
     drawCircle(circle);

   See also:
   circles2d, createDirectedCircle

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CREATECIRCLE Create a circle from 2 or 3 points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 683
CREATEDIRECTEDCIRCLE Create a directed circle.

   C = createDirectedCircle(P1, P2, P3);
   Creates a circle going through the given points.
   C is a 1*4 array of the form: [XC YC R INV].
   The last parameter is set to 1 if the points are located in clockwise
   order on the circle.

   C = createDirectedCircle(P1, P2);
   Creates the circle whith center P1 and passing throuh the point P2.

   Works also when input are point arrays the same size, in this case the
   result has as many lines as the point arrays.

   See also:
   circles2d, createCircle

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 12/01/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CREATEDIRECTEDCIRCLE Create a directed circle.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1011
CREATEEDGE Create an edge between two points, or from a line.

   The internal format for edge representation is given by coordinates of
   two points : [x1 y1 x2 y2].
   This function can serve as a line to edge converter.


   E = createEdge(P1, P2);
   Returns the edge between the two given points P1 and P2.
   
   E = createEdge(x0, y0, dx, dy);
   Returns the edge going through point (x0, y0) and with direction
   vector (dx,dy).

   E = createEdge(param);
   where param is an array of 4 values, creates the edge going through the
   point (param(1) param(2)), and with direction vector given by
   (param(3) param(4)).
   
   E = createEdge(LINE, D);
   create the edge contained in LINE, with same direction and start point,
   but with length given by D.


   Note: in all cases, parameters can be vertical arrays of the same
   dimension. The result is then an array of edges, of dimensions N-by-4.


   See also:
   edges2d, lines2d, drawEdge, clipEdge, createLine




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
CREATEEDGE Create an edge between two points, or from a line.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 640
CREATEHOMOTHECY Create the the 3x3 matrix of an homothetic transform.

   TRANS = createHomothecy(POINT, K);
   POINT is the center of the homothecy, K is its factor.
   TRANS is a 3-by-3 matrix representing the homothetic transform in
   homogeneous coordinates.

   Example:

      p  = [0 0; 1 0; 0 1];
      s  = [-0.5 0.4];
      T  = createHomothecy (s, 1.5);
      pT = transformPoint (p, T);
      drawPolygon (p,'-b')
      hold on;
      drawPolygon (pT, '-r');
      
      drawEdge (p(:,1), p(:,2), pT(:,1), pT(:,2), ...
                'color', 'k','linestyle','--')
      hold off
      axis tight equal




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
CREATEHOMOTHECY Create the the 3x3 matrix of an homothetic transform.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1340
CREATELINE Create a straight line from 2 points, or from other inputs.

   Line is represented in a parametric form : [x0 y0 dx dy]
   x = x0 + t*dx
   y = y0 + t*dy;


   L = createLine(p1, p2);
   Returns the line going through the two given points.
   
   L = createLine(x0, y0, dx, dy);
   Returns the line going through point (x0, y0) and with direction
   vector(dx, dy).

   L = createLine(LINE);
   where LINE is an array of 4 values, creates the line going through the
   point (LINE(1) LINE(2)), and with direction given by vector (LINE(3)
   LINE(4)). 
   
   L = createLine(THETA);
   Create a polar line originated at (0,0) and with angle THETA.

   L = createLine(p, THETA);
   Create a polar line originated at p and with angle THETA.

   L = createLine(RHO, THETA);
   Create a polar line with normal theta, and with min distance to origin
   equal to rho. rho can be negative, in this case, the line is the same
   as with CREATELINE(-rho, theta+pi), but the orientation is different.


   Note: in all cases, parameters can be vertical arrays of the same
   dimension. The result is then an array of lines, of dimensions [N*4].


   See also:
   lines2d, createEdge, createRay

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
CREATELINE Create a straight line from 2 points, or from other inputs.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 453
CREATELINEREFLECTION Create the the 3x3 matrix of a line reflection.

   TRANS = createLineReflection(LINE);
   where line is given as [x0 y0 dx dy], return the affine tansform
   corresponding to the desired line reflection


   See also:
   lines2d, transforms2d, transformPoint, 
   createTranslation, createHomothecy, createScaling

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 19/01/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
CREATELINEREFLECTION Create the the 3x3 matrix of a line reflection.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 876
CREATERAY Create a ray (half-line), from various inputs.

   RAY = createRay(POINT, ANGLE)
   POINT is a N*2 array giving starting point of the ray, and ANGLE is the
   orientation of the ray.

   RAY = createRay(X0, Y0, ANGLE)
   Specify ray origin with 2 input arguments.

   RAY = createRay(P1, P2)
   Create a ray starting from point P1 and going in the direction of point
   P2.

   Ray is represented in a parametric form: [x0 y0 dx dy]
   x = x0 + t*dx
   y = y0 + t*dy;
   for all t>0

   Example
   origin  = [3 4];
   theta   = pi/6;
   ray = createRay(origin, theta);
   figure(1); clf; hold on;
   axis([0 10 0 10]);
   drawRay(ray);

   See also:
   rays2d, createLine, points2d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2007-10-18
 Copyright 2007 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
CREATERAY Create a ray (half-line), from various inputs.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 972
CREATEROTATION Create the 3*3 matrix of a rotation.

   TRANS = createRotation(THETA);
   Returns the rotation corresponding to angle THETA (in radians)
   The returned matrix has the form :
   [cos(theta) -sin(theta)  0]
   [sin(theta)  cos(theta)  0]
   [0           0           1]

   TRANS = createRotation(POINT, THETA);
   TRANS = createRotation(X0, Y0, THETA);
   Also specifies origin of rotation. The result is similar as performing
   translation(-X0, -Y0), rotation(THETA), and translation(X0, Y0).

   Example
     % apply a rotation on a polygon
     poly = [0 0; 30 0;30 10;10 10;10 20;0 20];
     trans = createRotation([10 20], pi/6);
     polyT = transformPoint(poly, trans);
     % display the original and the rotated polygons
     figure; hold on; axis equal; axis([-10 40 -10 40]);
     drawPolygon(poly, 'k');
     drawPolygon(polyT, 'b');

   See also:
   transforms2d, transformPoint, createRotation90, createTranslation




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
CREATEROTATION Create the 3*3 matrix of a rotation.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1128
CREATEROTATION90  Matrix of a rotation for 90 degrees multiples.

   MAT = createRotation90
   Returns the 3-by-3 matrix corresponding to a rotation by 90 degrees.
   As trigonometric functions are explicitley converted to +1 or -1, the
   resulting matrix obtained with this function is more precise than 
   the one obtained with createRotation.

   MAT = createRotation90(NUM)
   Specifies the number of rotations to performs. NUM should be an integer
   (possibly negative).

   Example
     poly = [10 0;20 0;10 10];
     rot = createRotation90;
     poly2 = transformPoint(poly, rot);
     figure; hold on; axis equal;
     drawPolygon(poly);
     drawPolygon(poly2, 'm');
     legend('original', 'rotated');

     % specify number of rotations, and center
     rot = createRotation90(2, [10 10]);
     poly3 = transformPoint(poly, rot);
     drawPolygon(poly3, 'g');

   See also
   transforms2d, createRotation

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
CREATEROTATION90  Matrix of a rotation for 90 degrees multiples.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 604
CREATESCALING Create the 3*3 matrix of a scaling in 2 dimensions.

   TRANS = createScaling(SX, SY);
   return the matrix corresponding to scaling by SX and SY in the 2
   main directions.
   The returned matrix has the form:
   [SX  0  0]
   [0  SY  0]
   [0   0  1]

   TRANS = createScaling(SX);
   Assume SX and SY are equals.

   TRANS = createScaling(CENTER, ...);
   Specifies the center of the scaling transform. The argument CENTER
   should be a 1-by-2 array representing coordinates of center.

   See also:
   transforms2d, transformPoint, createTranslation, createRotation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
CREATESCALING Create the 3*3 matrix of a scaling in 2 dimensions.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
createTranslation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 539
CREATETRANSLATION Create the 3*3 matrix of a translation.

   TRANS = createTranslation(DX, DY);
   Returns the translation corresponding to DX and DY.
   The returned matrix has the form :
   [1 0 TX]
   [0 1 TY]
   [0 0  1]

   TRANS = createTranslation(VECTOR);
   Returns the matrix corresponding to a translation by the vector [x y].


   See also:
   transforms2d, transformPoint, createRotation, createScaling

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 06/04/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
CREATETRANSLATION Create the 3*3 matrix of a translation.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 708
CREATEVECTOR Create a vector from two points.

   V12 = createVector(P1, P2)
   Creates the vector V12, defined as the difference between coordinates
   of points P1 and P2.
   P1 and P2 are row vectors with ND elements, ND being the space
   dimension.

   If one of the inputs is a N-by-Nd array, the other input is
   automatically repeated, and the result is N-by-Nd.

   If both inputs have the same size, the result also have the same size.


   Example

   See also
   vectors2d, vectors3d, points2d


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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CREATEVECTOR Create a vector from two points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 986
CUBICBEZIERTOPOLYLINE Compute equivalent polyline from bezier curve control.

   POLY = cubicBezierToPolyline(POINTS, N)
   Creates a polyline with N edges from the coordinates of the 4 control
   points stored in POINTS. 
   POINTS is either a 4-by-2 array (vertical concatenation of point
   coordinates), or a 1-by-8 array (horizontal concatenation of point
   coordinates). 
   The result is a (N-1)-by-2 array.

   POLY = cubicBezierToPolyline(POINTS)
   Assumes N = 64 edges as default.

   [X Y] = cubicBezierToPolyline(...)
   Returns the result in two separate arrays for X and Y coordinates.


   Example
     poly = cubicBezierToPolyline([0 0;5 10;10 5;10 0], 100);
     drawPolyline(poly, 'linewidth', 2, 'color', 'g');

   See also
     drawBezierCurve, drawPolyline


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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
CUBICBEZIERTOPOLYLINE Compute equivalent polyline from bezier curve control.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
distancePointEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1316
DISTANCEPOINTEDGE Minimum distance between a point and an edge.

   DIST = distancePointEdge(POINT, EDGE);
   Return the euclidean distance between edge EDGE and point POINT. 
   EDGE has the form: [x1 y1 x2 y2], and POINT is [x y].

   If EDGE is N-by-4 array, result is 1-by-4 array computed for each edge.
   If POINT is a N-by-2 array, the result is a N-by-1 array.
   If both POINT and EDGE are array, the result is computed for each
   point-edge couple, and stored into a NP-by-NE array.

   [DIST POS] = distancePointEdge(POINT, EDGE);
   Also returns the position of closest point on the edge. POS is
   comprised between 0 (first point) and 1 (last point).

   Eaxmple
     % Distance between a point and an edge
     distancePointEdge([3 4], [0 0 10 0])
     ans =
         4

     % Distance between several points and one edge
     points = [10 15; 15 10; 30 10];
     edge   = [10 10 20 10];
     distancePointEdge(points, edge)
     ans = 
         5 
         0
        10

     % Distance between a point a several edges
     point = [14 33];
     edges  = [10 30 20 30; 20 30 20 40;20 40 10 40;10 40 10 30];
     distancePointEdge(point, edges)
     ans = 
         3    6    7    4


   See also:
   edges2d, points2d, distancePoints, distancePointLine
   



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
DISTANCEPOINTEDGE Minimum distance between a point and an edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
distancePointLine


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 659
DISTANCEPOINTLINE Minimum distance between a point and a line.

   D = distancePointLine(POINT, LINE)
   Return the euclidean distance between line LINE and point POINT. 

   LINE has the form: [x0 y0 dx dy], and POINT is [x y].

   If LINE is N-by-4 array, result is N-by-1 array computes for each line.

   If POINT is N-by-2, then result is computed for each point.

   If both POINT and LINE are array, result is computed for each couple of
   point and line, and is returned in a NP-by-NL array, where NP is the
   number of points, and NL is the number of lines.


   See also:
   lines2d, points2d, distancePoints, distancePointEdge




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
DISTANCEPOINTLINE Minimum distance between a point and a line.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 755
DISTANCEPOINTS Compute distance between two points.

   D = distancePoints(P1, P2)
   Return the Euclidean distance between points P1 and P2.

   If P1 and P2 are two arrays of points, result is a N1-by-N2 array
   containing distance between each point of P1 and each point of P2. 

   D = distancePoints(P1, P2, NORM)
   Compute distance using the specified norm. NORM=2 corresponds to usual
   euclidean distance, NORM=1 corresponds to Manhattan distance, NORM=inf
   is assumed to correspond to maximum difference in coordinate. Other
   values (>0) can be specified.

   D = distancePoints(..., 'diag')
   compute only distances between P1(i,:) and P2(i,:).

   See also:
   points2d, minDistancePoints, nndist, hausdorffDistance




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
DISTANCEPOINTS Compute distance between two points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 998
DRAWARROW Draw an arrow on the current axis.
   
   drawArrow(x1, y1, x2, y2) 
   draws an arrow between the points (x1 y1) and (x2 y2).

   drawArrow([x1 y1 x2 y2])
   gives argument as a single array.

   drawArrow(..., L, W)
   specifies length and width of the arrow.

   drawArrow(..., L, W, TYPE)
   also specifies arrow type. TYPE can be one of the following :
   0: draw only two strokes
   1: fill a triangle
   .5: draw a half arrow (try it to see ...)
   
   Arguments can be single values or array of size N-by-1. In this case,
   the function draws multiple arrows.

   H = drawArrow(...) 
   return handle(s) to created arrow elements.
   The handles are returned in a structure with the fields
   'body', 'wing' and 'head' containing the handles to the different
   parts of the arrow(s).

   Example
     t = linspace(0, 2*pi, 200);
     figure; hold on;
     plot(t, sin(t)); 
     drawArrow([2 -1 pi 0], .1, .05, .5)
 
   See also
     drawEdge




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
DRAWARROW Draw an arrow on the current axis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1016
DRAWBEZIERCURVE Draw a cubic bezier curve defined by 4 control points.

   drawBezierCurve(POINTS)
   Draw the Bezier curve defined by the 4 control points stored in POINTS.
   POINTS is either a 4-by-2 array (vertical concatenation of control
   points coordinates), or a 1-by-8 array (horizontal concatenation of
   control point coordinates). 

   drawBezierCurve(..., PARAM, VALUE)
   Specifies additional drawing parameters, see the line function for
   details.

   drawBezierCurve(AX, ...);
   Spcifies the handle of the axis to draw on.

   H = drawBezierCurve(...);
   Return a handle to the created graphic object.


   Example
     drawBezierCurve([0 0;5 10;10 5;10 0]);
     drawBezierCurve([0 0;5 10;10 5;10 0], 'linewidth', 2, 'color', 'g');

   See also
     drawPolyline, cubicBezierToPolyline

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
DRAWBEZIERCURVE Draw a cubic bezier curve defined by 4 control points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
drawBox


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 768
DRAWBOX Draw a box defined by coordinate extents.
   
   drawBox(BOX)
   Draws a box defined by its extent: BOX = [XMIN XMAX YMIN YMAX].

   drawBox(..., NAME, VALUE)
   Specifies drawing parameters using parameter name and value. See plot
   function for syntax.

   drawBox(AX, ...)
   Specifies the handle of the axis to draw on.

   Example
     % define some points, compute their box, display everything
     points = [10 30; 20 50; 20 20; 30 10;40 30;50 20];
     box = pointSetBounds(points);
     figure; hold on;
     drawPoint(points, 's');
     drawBox(box);
     axis([0 60 0 60]);

   See Also:
   drawOrientedBox, drawRect

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 10/12/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
DRAWBOX Draw a box defined by coordinate extents.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1598
DRAWCENTEREDEDGE Draw an edge centered on a point.
   
   Draws a centered edge, defined by a center, a length and an orientation
   (in degrees). This function can be used to draw principal axes of an
   ellipse or of an oriented box.


   drawCenteredEdge(EDGE)
   Draws an edge centered on a point. EDGE has format [XC YC L THETA],
   with (Xc, YC) being edge center, L being the edge length, and THETA
   beigng the edge orientation, in degrees (counted Counter-clockwise from
   horizontal).
   Input argument can also be a N-by-4 array, in that can several edges
   are drawn.

   drawCenteredEdge(CENTER, L, THETA)
   Specifies argument in seperate inputs.

   drawCenteredEdge(..., NAME, VALUE)
   Also specifies drawing options by using one or several parameter name -
   value pairs (see doc of plot function for details).

   drawCenteredEdge(AX, ...)
   Specifies the axis to draw the edge on.

   H = drawCenteredEdge(...)
   Returns handle(s) to the created edges(s).

   Example
     % Draw an ellipse with its two axes
     figure(1); clf;
     center = [50 40];
     r1 = 30; r2 = 10;
     theta = 20;
     elli = [center r1 r2 theta];
     drawEllipse(elli, 'linewidth', 2);
     axis([0 100 0 100]); axis equal;
     hold on;
     edges = [center 2*r1 theta ; center 2*r2 theta+90];
     drawCenteredEdge(edges, 'linewidth', 2, 'color', 'g');
 
   See also:
   edges2d, drawOrientedBox, drawEllipse, centeredEdgeToEdge, drawEdge

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 05/08/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
DRAWCENTEREDEDGE Draw an edge centered on a point.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1136
DRAWCIRCLE Draw a circle on the current axis.

   drawCircle(X0, Y0, R);
   Draw the circle with center (X0,Y0) and the radius R. If X0, Y0 and R
   are column vectors of the same length, draw each circle successively.

   drawCircle(CIRCLE);
   Concatenate all parameters in a Nx3 array, where N is the number of
   circles to draw.

   drawCircle(CENTER, RADIUS);
   Specify CENTER as Nx2 array, and radius as a Nx1 array.

   drawCircle(..., NSTEP);
   Specify the number of edges that will be used to draw the circle.
   Default value is 72, creating an approximation of one point for each 5
   degrees.

   drawCircle(..., NAME, VALUE);
   Specifies plotting options as pair of parameters name/value. See plot
   documentation for details.

   drawCircle(AX, ...)
   Specifies the handle of the axis to draw on.

   H = drawCircle(...);
   return handles to each created curve.

   Example
     figure;
     hold on;
     drawCircle([10 20 30]);
     drawCircle([15 15 40], 'color', 'r', 'linewidth', 2);
     axis equal;

   See also
   circles2d, drawCircleArc, drawEllipse, circleToPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
DRAWCIRCLE Draw a circle on the current axis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1086
DRAWCIRCLEARC Draw a circle arc on the current axis.

   drawCircleArc(ARC);
   Draws circle arc defined by ARC = [XC YC R START EXTENT], with (XC, YC)
   being the circle center, R being the circle radius, starting from angle 
   START, and with angular extent given by EXTENT. START and EXTENT angles
   are given in degrees.

   drawCircleArc(XC, YC, R, START, EXTENT);
   Alternative syntax that seperates inputs.

   drawCircleArc(..., PARAM, VALUE);
   specifies plot properties by using one or several parameter name-value
   pairs.

   drawCircleArc(AX, ...);
   Specifies handle of the axis to draw on.

   H = drawCircleArc(...);
   Returns a handle to the created line object.

   Example
     % Draw a red thick circle arc
     arc = [10 20 30 -120 240];
     figure;
     axis([-50 100 -50 100]);
     hold on
     drawCircleArc(arc, 'LineWidth', 3, 'Color', 'r')

   See also:
   circles2d, drawCircle, drawEllipse, circleArcToPolyline

   --------
   author: David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 12/12/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
DRAWCIRCLEARC Draw a circle arc on the current axis.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 755
DRAWEDGE Draw an edge given by 2 points.
   
   drawEdge(x1, y1, x2, y2);
   draw an edge between the points (x1 y1) and  (x2 y2).

   drawEdge([x1 y1 x2 y2]) ;
   drawEdge([x1 y1], [x2 y2]);
   specify data either as bundled edge, or as 2 points

   The function supports 3D edges:
   drawEdge([x1 y1 z1 x2 y2 z2]);
   drawEdge([x1 y1 z1], [x2 y2 z2]);
   drawEdge(x1, y1, z1, x2, y2, z2);

   Arguments can be single values or array of size [N*1]. In this case,
   the function draws multiple edges.

   H = drawEdge(..., OPT), with OPT being a set of pairwise options, can
   specify color, line width and so on...

   H = drawEdge(...) return handle(s) to created edges(s)

   See also:
   edges2d, drawCenteredEdge, drawLine




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
DRAWEDGE Draw an edge given by 2 points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1181
DRAWELLIPSE Draw an ellipse on the current axis.

   drawEllipse(ELLI);
   Draws the ellipse ELLI in the form [XC YC RA RB THETA], with center
   (XC, YC), with main axis of half-length RA and RB, and orientation
   THETA in degrees counted counter-clockwise.

   drawEllipse(XC, YC, RA, RB);
   drawEllipse(XC, YC, RA, RB, THETA);
   Specifies ellipse parameters as separate arguments (old syntax).

   drawEllipse(..., NAME, VALUE);
   Specifies drawing style of ellipse, see the help of plot function.

   H = drawEllipse(...);
   Also returns handles to the created line objects.

   -> Parameters can also be arrays. In this case, all arrays are supposed 
   to have the same size.

   Example:
   % Draw an ellipse centered in [50 50], with semi major axis length of
   % 40, semi minor axis length of 20, and rotated by 30 degrees.
     figure(1); clf; hold on;
     drawEllipse([50 50 40 20 30]);
     axis equal; axis([0 100 10 90])

   % add another ellipse with different orientation and style
     drawEllipse([50 50 40 20 -10], 'linewidth', 2, 'color', 'g');

   See also:
     ellipses2d, drawCircle, drawEllipseArc, ellipseToPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
DRAWELLIPSE Draw an ellipse on the current axis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1571
DRAWELLIPSEARC Draw an ellipse arc on the current axis.

   drawEllipseArc(ARC) 
   draw ellipse arc specified by ARC. ARC has the format:
     ARC = [XC YC A B THETA T1 T2]
   or:
     ARC = [XC YC A B T1 T2] (isothetic ellipse)
   with center (XC, YC), main axis of half-length A, second axis of
   half-length B, and ellipse arc running from t1 to t2 (both in degrees,
   in Counter-Clockwise orientation).

   Parameters can also be arrays. In this case, all arrays are suposed to
   have the same size...

   drawEllipseArc(..., NAME, VALUE)
   Specifies one or more parameters name-value pairs, as in the plot
   function.

   drawEllipseArc(AX, ...)
   Sepcifies the handle of theaxis to draw on.

   H = drawEllipseArc(...)
   Returns handle(s) of the created graphic objects.

   Example
     % draw an ellipse arc: center = [10 20], radii = 50 and 30, theta = 45
     arc = [10 20 50 30 45 -90 270];
     figure;
     axis([-50 100 -50 100]); axis equal;
     hold on
     drawEllipseArc(arc, 'color', 'r')

     % draw another ellipse arc, between angles -60 and 70
     arc = [10 20 50 30 45 -60 (60+70)];
     figure;
     axis([-50 100 -50 100]); axis equal;
     hold on
     drawEllipseArc(arc, 'LineWidth', 2);
     ray1 = createRay([10 20], deg2rad(-60+45));
     drawRay(ray1)
     ray2 = createRay([10 20], deg2rad(70+45));
     drawRay(ray2)

   See also:
   ellipses2d, drawEllipse, drawCircleArc

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 12/12/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
DRAWELLIPSEARC Draw an ellipse arc on the current axis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 705
 Draw labels at specified positions.
   
   drawLabels(X, Y, LBL)
   Draws labels LBL at positions given by X and Y.
   LBL can be either a string array, or a number array. In this case,
   string are created by using sprintf function, using the '%.2f' format.

   drawLabels(POS, LBL)
   Draws labels LBL at position specified by POS, where POS is a N-by-2
   numeric array. 

   drawLabels(..., NUMBERS, FORMAT)
   Creates labels using sprintf function, with the mask given by FORMAT 
   (e.g. '%03d' or '5.3f'), and the corresponding values.

   drawLabels(..., PNAME, PVALUE)
   Specifies additional parameters to the created labels. See 'text'
   properties for available values.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
 Draw labels at specified positions.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawLine


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 749
DRAWLINE Draw a straight line clipped by the current axis.

   drawLine(LINE);
   Draws the line LINE on the current axis, by using current axis to clip
   the line. 

   drawLine(LINE, PARAM, VALUE);
   Specifies drawing options.

   H = drawLine(...)
   Returns a handle to the created line object. If clipped line is not
   contained in the axis, the function returns -1.
   
   Example
     figure; hold on; axis equal;
     axis([0 100 0 100]);
     drawLine([30 40 10 20]);
     drawLine([30 40 20 -10], 'Color', 'm', 'LineWidth', 2);
     drawLine([-30 140 10 20]);

   See also:
   lines2d, createLine, drawEdge

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
DRAWLINE Draw a straight line clipped by the current axis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1362
DRAWORIENTEDBOX Draw centered oriented rectangle.
   
   Syntax
   drawOrientedBox(BOX)
   drawOrientedBox(BOX, 'PropertyName', propertyvalue, ...)

   Description
   drawOrientedBox(OBOX)
   Draws an oriented rectangle (or bounding box) on the current axis. 
   OBOX is a 1-by-5 row vector containing box center, dimension (length
   and width) and orientation (in degrees): 
   OBOX = [CX CY LENGTH WIDTH THETA].

   When OBOX is a N-by-5 array, the N boxes are drawn.

   drawOrientedBox(AX, ...) 
   Specifies the axis to draw to point in. AX should be a handle to a axis
   object. By default, display on current axis.

   HB = drawOrientedBox(...) 
   Returns a handle to the created graphic object(s). Object style can be
   modified using syntaw like:
   set(HB, 'color', 'g', 'linewidth', 2);

   Example
     % draw an ellipse together with its oriented box
     elli = [30 40 60 30 20];
     figure; 
     drawEllipse(elli, 'linewidth', 2, 'color', 'g');
     hold on
     box = [30 40 120 60 20];
     drawOrientedBox(box, 'color', 'k');
     axis equal;

   See also
   orientedBox, drawPolygon, drawRect, drawBox, drawCenteredEdge

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
DRAWORIENTEDBOX Draw centered oriented rectangle.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1537
DRAWPARABOLA Draw a parabola on the current axis.

   drawParabola(PARABOLA);
   Draws a vertical parabola, defined by its vertex and its parameter.
   Such a parabola admits a vertical axis of symetry.

   The algebraic equation of parabola is given by:
      (Y - YV) = A * (X - VX)^2
   Where XV and YV are vertex coordinates and A is parabola parameter.

   A parametric equation of parabola is given by:
      x(t) = t + VX;
      y(t) = A * t^2 + VY;

   PARABOLA can also be defined by [XV YV A THETA], with theta being the
   angle of rotation of the parabola (in degrees and Counter-Clockwise).

   drawParabola(PARABOLA, T);
   Specifies which range of 't' are used for drawing parabola. If T is an
   array with only two values, the first and the last values are used as
   interval bounds, and several values are distributed within this
   interval.

   drawParabola(..., NAME, VALUE);
   Can specify one or several graphical options using parameter name-value
   pairs.

   drawParabola(AX, ...);
   Specifies handle of the axis to draw on.

   H = drawParabola(...);
   Returns an handle to the created graphical object.


   Example:
     figure(1); clf; hold on;
     axis equal; axis([0 100 0 100])
     % draw parabola with default parameterization bounds 
     drawParabola([50 50 .2 30]);
     % draw parabola with more specific bounds and drawing style
     drawParabola([50 50 .2 30], [-3 3], 'color', 'r', 'linewidth', 2);
   

   See Also:
   drawCircle, drawEllipse




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
DRAWPARABOLA Draw a parabola on the current axis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1097
DRAWPOINT Draw the point on the axis.

   drawPoint(X, Y);
   Draws points defined by coordinates X and Y.
   X and Y should be array the same size.

   drawPoint(COORD);
   Packs coordinates in a single N-by-2 array.

   drawPoint(..., OPT);
   Draws each point with given option. OPT is a series of arguments pairs
   compatible with 'plot' model. Default drawing option is 'bo',
   corresponding to blue circles.
   If a format string is used then only the color is effective.
   Markers can be set using the 'marker' property.
   The property 'linestyle' cannot be set.

   drawPoint(AX, ...);
   Specifies the axis to draw the points in. AX should be a handle to a axis
   object. By default, display on current axis.

   H = drawPoint(...) also return a handle to each of the drawn points.

   Example
     % display a single point
     figure;
     drawPoint([10 10]);

     % display several points forming a circle
     t = linspace(0, 2*pi, 20)';
     drawPoint([5*cos(t)+10 3*sin(t)+10], 'r+');
     axis equal;

   See also
     points2d, clipPoints



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
DRAWPOINT Draw the point on the axis.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
drawRay


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 499
DRAWRAY Draw a ray on the current axis.

   drawRay(RAY)
   With RAY having the syntax: [x0 y0 dx dy], draws the ray starting from
   point (x0 y0) and going to direction (dx dy), clipped with the current
   window axis.

   drawRay(RAY, PARAMS, VALUE)
   Can specify param-pair values.

   H = drawRay(...)
   Returns handle on line object

   See also:
   rays2d, drawLine

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
DRAWRAY Draw a ray on the current axis.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawRect


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 756
DRAWRECT Draw rectangle on the current axis.
   
   drawRect(RECT)
   draws the rectangles defined by RECT = [X0 Y0 W H].
   the four corners of rectangle are then :
   (X0, Y0), (X0+W, Y0), (X0, Y0+H), (X0+W, Y0+H).

   RECT = [X0 Y0 W H THETA] also specifies orientation for the rectangle.
   Theta is given in degrees.

   If RECT is a N-by-4 or N-by-5 array, several rectangles are drawn.

   drawRect(..., PARAM, VALUE)
   Specifies one or several parameters name-value pairs, see plot function
   for details.

   drawRect(AX, ...) 
   Specifies the handle of the axis to draw the rectangle on.

   H = drawRect(...) 
   Returns handle of the created graphic objects.

   See Also:
   drawOrientedBox, drawBox, rectToPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
DRAWRECT Draw rectangle on the current axis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 810
DRAWSHAPE Draw various types of shapes (circles, polygons...).

   drawShape(TYPE, PARAM)
   Draw the shape of type TYPE, specified by given parameter PARAM. TYPE
   can be one of {'circle', 'ellipse', 'rect', 'polygon', 'curve'}
   PARAM depend on the type. For example, if TYPE is 'circle', PARAM will
   contain [x0 y0 R].

   Examples :
   drawShape('circle', [20 10 30]);
   Draw circle centered on [20 10] with radius 10.
   drawShape('rect', [20 20 40 10 pi/3]);
   Draw rectangle centered on [20 20] with length 40 and width 10, and
   oriented pi/3 wrt axis Ox.
   

   drawShape(..., OPTION)
   also specifies drawing options. OPTION can be 'draw' (default) or
   'fill'.

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 07/04/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
DRAWSHAPE Draw various types of shapes (circles, polygons...).



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 591
DRAWVECTOR Draw vector at a given position.

   drawVector(POS, VECT)
   POS should be a N-by-2 or N-by-3 array containing position of vector
   origins, and VECT should be a N-by-2 or N-by-3 array containing the
   direction of the vectors.

   Example
     figure; hold on;
     drawVector([1 2], [3 2]);
     drawVector([1 2], [-2 3]);
     axis equal;

   See also
     quiver, drawVector3d

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
DRAWVECTOR Draw vector at a given position.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 589
EDGEANGLE Return angle of edge.

   A = edgeAngle(EDGE)
   Returns the angle between horizontal, right-axis and the edge EDGE.
   Angle is given in radians, between 0 and 2*pi, in counter-clockwise
   direction. 
   Notation for edge is [x1 y1 x2 y2] (coordinates of starting and ending
   points).

   Example
   p1 = [10 20];
   p2 = [30 40];
   rad2deg(edgeAngle([p1 p2]))
   ans = 
       45

   See also
   edges2d, angles2d, edgeAngle, lineAngle, edgeLength

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 06/04/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
EDGEANGLE Return angle of edge.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 508
EDGELENGTH Return length of an edge.

   L = edgeLength(EDGE);  
   Returns the length of an edge, with parametric representation:
   [x1 y1 x2 y2].

   The function also works for several edges, in this case input is a
   N-by-4 array, containing parametric representation of each edge, and
   output is a N-by-1 array containing length of each edge.

   See also:
   edges2d, edgeAngle

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 19/02/2004




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
EDGELENGTH Return length of an edge.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1174
EDGEPOSITION Return position of a point on an edge.

   POS = edgePosition(POINT, EDGE);
   Computes position of point POINT on the edge EDGE, relative to the
   position of edge vertices.
   EDGE has the form [x1 y1 x2 y2],
   POINT has the form [x y], and is assumed to belong to edge.
   The result POS has the following meaning:
     POS < 0:      POINT is located before the first vertex
     POS = 0:      POINT is located on the first vertex
     0 < POS < 1:  POINT is located between the 2 vertices (on the edge)
     POS = 1:      POINT is located on the second vertex
     POS < 0:      POINT is located after the second vertex

   POS = edgePosition(POINT, EDGES);
   If EDGES is an array of NL edges, return NE positions, corresponding to
   each edge.

   POS = edgePosition(POINTS, EDGE);
   If POINTS is an array of NP points, return NP positions, corresponding
   to each point.

   POS = edgePosition(POINTS, EDGES);
   If POINTS is an array of NP points and EDGES is an array of NE edges,
   return an array of [NP NE] position, corresponding to each couple
   point-edge.

   See also:
   edges2d, createEdge, isPointOnEdge




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
EDGEPOSITION Return position of a point on an edge.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 467
EDGETOLINE Convert an edge to a straight line.

   LINE = edgeToLine(EDGE);
   Returns the straight line containing the edge EDGE.
   EDGE is represented as [X1 Y1  X2 Y2]
   LINE is represented as [X0 Y0  DX DY]

   Example
       edge = [2 3 4 5];
       line = edgeToLine(edge);
       figure(1); hold on; axis([0 10 0 10]);
       drawLine(line, 'color', 'g')
       drawEdge(edge, 'linewidth', 2)
   
   See also
   edges2d, lines2d, lineToEdge




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
EDGETOLINE Convert an edge to a straight line.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 530
EDGETOPOLYLINE Convert an edge to a polyline with a given number of segments.

   POLY = edgeToPolyline(EDGE, N)
   
   Example
     edge = [10 20 60 40];
     poly = edgeToPolyline(edge, 10);
     drawEdge(edge, 'lineWidth', 2);
     hold on
     drawPoint(poly);
     axis equal;

   See also
     edges2d, drawEdge, drawPolyline   

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
EDGETOPOLYLINE Convert an edge to a polyline with a given number of segments.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
edges2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 838
EDGES2D  Description of functions operating on planar edges.

   An edge is represented by the coordinate of its extremities:
   EDGE = [X1 Y1 X2 Y2];

   Centered edges are sometimes used (for example for representing main
   axes of an ellipse or an oriented box). Centered edges are represented
   by their center, their length, and their orientation (counted in
   degrees and counter-clockwise).
   CEDGE = [XC YC LEN THETA];

   A set of edges is represented by a N-by-4 array, each row representing
   an edge.


   See also:
   lines2d, rays2d, points2d, createEdge, parallelEdge, 
   edgeAngle, edgeLength, midPoint, edgeToLine, lineToEdge
   intersectEdges, intersectLineEdge, isPointOnEdge, edgeToPolyline
   clipEdge, transformEdge, intersectEdgePolygon, centeredEdgeToEdge
   drawEdge, drawCenteredEdge




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
EDGES2D  Description of functions operating on planar edges.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 650
ELLIPSEPERIMETER Perimeter of an ellipse.

   P = ellipsePerimeter(ELLI)
   Computes the perimeter of an ellipse, using numerical integration.
   ELLI is an ellipse, given using one of the following formats:
   * a 1-by-5 row vector containing coordinates of center, length of
       semi-axes, and orientation in degrees
   * a 1-by-2 row vector containing only the lengths of the semi-axes.
   The result

   P = ellipsePerimeter(ELLI, TOL)
   Specify the relative tolerance for numerical integration.


   Example
   P = ellipsePerimeter([30 40 30 10 15])
   P = 
       133.6489 

   See also
     ellipses2d, drawEllipse





# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ELLIPSEPERIMETER Perimeter of an ellipse.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 785
ELLIPSETOPOLYGON Convert an ellipse into a series of points.

   P = ellipseToPolygon(ELL, N);
   converts ELL given as [x0 y0 a b] or [x0 y0 a b theta] into a polygon
   with N edges. The result P is a N-by-2 array containing the coordinates
   of the N vertices of the polygon.

   P = ellipseToPolygon(ELL);
   Use a default number of edges equal to 72. This results in one point
   for each 5 degrees.
   
   [X, Y] = ellipseToPolygon(...);
   Return the coordinates of vertices in two separate arrays.

   Example
     poly = ellipseToPolygon([50 50 40 30 20], 60);
     figure; hold on;
     axis equal; axis([0 100 10 90]);
     drawPolygon(poly, 'b');
     drawPoint(poly, 'bo');

   See also:
   ellipses2d, drawEllipse, circleToPolygon, rectToPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
ELLIPSETOPOLYGON Convert an ellipse into a series of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 372
ELLIPSES2D Description of functions operating on ellipses.
   
   Ellipses are represented by their center, the length of their 2
   semi-axes length, and their angle from the Ox direction (in degrees). 
   E = [XC YC A B THETA];

   See also:
   circles2d, equivalentEllipse, isPointInEllipse, ellipsePerimeter
   ellipseToPolygon, drawEllipse, drawEllipseArc




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
ELLIPSES2D Description of functions operating on ellipses.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 468
ENCLOSINGCIRCLE Find the minimum circle enclosing a set of points.

   CIRCLE = enclosingCircle(POINTS);
   computes the circle CIRCLE=[xc yc r] which encloses all the points POINTS
   given as a N-by-2 array.


   Rewritten from a file from
           Yazan Ahed (yash78@gmail.com)

   which was rewritten from a Java applet by Shripad Thite:
   http://heyoka.cs.uiuc.edu/~thite/mincircle/

   See also:
   circles2d, points2d, boxes2d, circumCircle




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
ENCLOSINGCIRCLE Find the minimum circle enclosing a set of points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
equivalentEllipse


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1115
 Equivalent ellipse of a set of points.

   ELL = equivalentEllipse(PTS);
   Computes the ellips with the same moments up to the second order as the
   set of points specified by the N-by-2 array PTS.

   The result has the following form:
   ELL = [XC YC A B THETA],
   with XC and YC being the center of mass of the point set, A and B being
   the lengths of the equivalent ellipse (see below), and THETA being the
   angle of the first principal axis with the horizontal (counted in
   degrees between 0 and 180 in counter-clockwise direction). 
   A and B are the standard deviations of the point coordinates when
   ellipse is aligned with the principal axes.

   Example
     pts = randn(100, 2);
     pts = transformPoint(pts, createScaling(5, 2));
     pts = transformPoint(pts, createRotation(pi/6));
     pts = transformPoint(pts, createTranslation(3, 4));
     ell = equivalentEllipse(pts);
     figure(1); clf; hold on;
     drawPoint(pts);
     drawEllipse(ell, 'linewidth', 2, 'color', 'r');

   See also
     ellipses2d, drawEllipse, equivalentEllipsoid, principalAxes,
     principalAxesTransform 




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
 Equivalent ellipse of a set of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 418
FINDCLOSESTPOINT Find index of closest point in an array.

   INDEX = findClosestPoint(POINT, POINTARRAY)

   [INDEX, MINDIST] = findClosestPoint(POINT, POINTARRAY)
   Also returns the distance between POINT and closest point in
   POINTARRAY.

   Example
     pts = rand(10, 2);
     findClosestPoint(pts(4, :), pts)
     ans =
         4

   See also
    points2d, minDistancePoints, distancePoints




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
FINDCLOSESTPOINT Find index of closest point in an array.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1406
 Compute the affine transform that best register two point sets.

   TRANSFO = fitAffineTransform2d(REF, SRC)
   Returns the affine transform matrix that minimizes the distance between
   the reference point set REF and the point set SRC after transformation.
   Both REF and SRC must by N-by-2 arrays with the same number of rows,
   and the points must be in correspondence.
   The function minimizes the sum of the squared distances:
   CRIT = sum(distancePoints(REF, transformPoint(PTS, TRANSFO)).^2);

   Example
     % computes the transform the register two ellipses
     % create the reference poitn set
     elli = [50 50 40 20 30];
     poly = resamplePolygonByLength(ellipseToPolygon(elli, 200), 5);
     figure; axis equal; axis([0 100 0 100]); hold on;
     drawPoint(poly, 'kx')
     % create the point set to fit on the reference
     trans0 = createRotation([20 60], -pi/8);
     poly2 = transformPoint(poly, trans0);
     poly2 = poly2 + randn(size(poly)) * 2;
     drawPoint(poly2, 'b+');
     % compute the transform that project poly2 onto poly.
     transfo = fitAffineTransform2d(poly, poly2);
     poly2t = transformPoint(poly2, transfo);
     drawPoint(poly2t, 'mo')
     legend('Reference', 'Initial', 'Transformed');

   See also
     transforms2d, transformPoint, transformVector,
     fitPolynomialTransform2d, registerICP, fitAffineTransform3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
 Compute the affine transform that best register two point sets.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 228
FITPOLYNOMIALTRANSFORM2D Coefficients of polynomial transform between two point sets.

   COEFFS = fitPolynomialTransform2d(PTS, PTSREF, DEGREE)

   Example
  
   See also
     polynomialTransform2d, fitAffineTransform2d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
FITPOLYNOMIALTRANSFORM2D Coefficients of polynomial transform between two poi...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
hausdorffDistance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1298
HAUSDORFFDISTANCE  Hausdorff distance between two point sets.

   HD = hausdorffDistance(PTS1, PTS2)
   Computes the Hausdorff distance between the two point sets PTS1 and
   PTS2. The Hausdorf distance can be used to compare two shapes. 

   The distance between a point x and a set Y is given by:
     d(x, Y) = inf { d(x,y) | y in Y }
   The distance between two non empty sets X and Y is given by:
     d(X, Y) = sup { d(x,Y) | x in X }
   The Hausdorff distance between sets X and Y distance is defined as the
   maximum of d(X,Y) and d(Y,X):
     HD(X,Y) = max { d(X,Y), d(Y,X) }


   Example
   % Compute Hausdorff distance between an ellipse and a rectangle
     % first define two shapes
     rect = resamplePolygon(orientedBoxToPolygon([20 30 80 40 30]), 60);
     poly = ellipseToPolygon([20 30 40 20 30], 500);
     % display the shapes
     figure; hold on
     drawPolygon(poly, 'b');
     drawPolygon(rect, 'g');
     axis equal;
     % compute hausdorff distance
     [hd ind1 ind2] = hausdorffDistance(poly, rect);
     p1h = poly(ind1, :);
     p2h = rect(ind2, :);
     drawPoint([p1h;p2h], 'mo');
     drawEdge([p1h p2h], 'm')

   See also
     points2d, minDistancePoints

   References
   http://en.wikipedia.org/wiki/Hausdorff_distance




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
HAUSDORFFDISTANCE  Hausdorff distance between two point sets.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 402
HEXAGONALGRID Generate hexagonal grid of points in the plane.

   usage:
   PTS = hexagonalGrid(BOUNDS, ORIGIN, SIZE)
   generate points, lying in the window defined by BOUNDS (=[xmin ymin
   xmax ymax]), starting from origin with a constant step equal to size.
   SIZE is constant and is equals to the length of the sides of each
   hexagon. 

   TODO: add possibility to use rotated grid




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
HEXAGONALGRID Generate hexagonal grid of points in the plane.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1054
INERTIAELLIPSE Inertia ellipse of a set of points.

   Note: Deprecated! Use equivalentEllipse instead.

   ELL = inertiaEllipse(PTS);
   where PTS is a N*2 array containing coordinates of N points, computes
   the inertia ellipse of the set of points.

   The result has the form:
   ELL = [XC YC A B THETA],
   with XC and YC being the center of mass of the point set, A and B are
   the lengths of the inertia ellipse (see below), and THETA is the angle
   of the main inertia axis with the horizontal (counted in degrees
   between 0 and 180). 
   A and B are the standard deviations of the point coordinates when
   ellipse is aligned with the principal axes.

   Example
   pts = randn(100, 2);
   pts = transformPoint(pts, createScaling(5, 2));
   pts = transformPoint(pts, createRotation(pi/6));
   pts = transformPoint(pts, createTranslation(3, 4));
   ell = inertiaEllipse(pts);
   figure(1); clf; hold on;
   drawPoint(pts);
   drawEllipse(ell, 'linewidth', 2, 'color', 'r');

   See also
     equivalentEllipse




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
INERTIAELLIPSE Inertia ellipse of a set of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 444
INTERSECTBOXES Intersection of two bounding boxes.

   RES = intersectBoxes(BOX1, BOX2)

   Example
   box1 = [5 20 5 30];
   box2 = [0 15 0 15];
   intersectBoxes(box1, box2)
   ans = 
       5 15 5 15

   See also
   boxes2d, drawBox, mergeBoxes


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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
INTERSECTBOXES Intersection of two bounding boxes.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1367
INTERSECTCIRCLES Intersection points of two circles.

   POINTS = intersectCircles(CIRCLE1, CIRCLE2)
   Computes the intersetion point of the two circles CIRCLE1 and CIRCLE1.
   Both circles are given with format: [XC YC R], with (XC,YC) being the
   coordinates of the center and R being the radius.
   POINTS is a 2-by-2 array, containing coordinate of an intersection
   point on each row. 
   In the case of tangent circles, the intersection is returned twice. It
   can be simplified by using the 'unique' function.

   Example
     % intersection points of two distant circles
     c1 = [0  0 10];
     c2 = [10 0 10];
     pts = intersectCircles(c1, c2)
     pts =
         5   -8.6603
         5    8.6603

     % intersection points of two tangent circles
     c1 = [0  0 10];
     c2 = [20 0 10];
     pts = intersectCircles(c1, c2)
     pts =
         10    0
         10    0
     pts2 = unique(pts, 'rows')
     pts2 = 
         10    0

   References
   http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/
   http://mathworld.wolfram.com/Circle-CircleIntersection.html

   See also
   circles2d, intersectLineCircle, radicalAxis


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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
INTERSECTCIRCLES Intersection points of two circles.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1022
INTERSECTEDGES Return all intersections between two set of edges.

   P = intersectEdges(E1, E2);
   returns the intersection point of edges E1 and E2. 
   E1 and E2 are 1-by-4 arrays, containing parametric representation of
   each edge (in the form [x1 y1 x2 y2], see 'createEdge' for details).
   
   In case of colinear edges, the result P contains [Inf Inf].
   In case of parallel but not colinear edges, the result P contains 
   [NaN NaN]. 

   If each input is N-by-4 array, the result is a N-by-2 array containing
   the intersection of each couple of edges.
   If one of the input has N rows and the other 1 row, the result is a
   N-by-2 array.

   P = intersectEdges(E1, E2, TOL);
   Specifies a tolerance parameter to determine parallel and colinear
   edges, and if a point belongs to an edge or not. The latter test is
   performed on the relative position of the intersection point over the
   edge, that should lie within [-TOL; 1+TOL]. 

   See also:
   edges2d, intersectLines




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
INTERSECTEDGES Return all intersections between two set of edges.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1017
 Intersection point(s) of a line and a circle.

   INTERS = intersectLineCircle(LINE, CIRCLE);
   Returns a 2-by-2-by-N array, containing on each row the coordinates of
   an intersection point for each line-circle pair, i.e. INTERS(:,:,k)
   contains the intersections between LINE(k,:) and CIRCLE(k,:).

   If a line-circle pair does not intersect, the corresponding results are
   set to NaN. 

   Example
     % base point
     center = [10 0];
     % create vertical line
     l1 = [center 0 1];
     % circle
     c1 = [center 5];
     pts = intersectLineCircle(l1, c1)
     pts =
     10   -5
     10    5
     % draw the result
     figure; clf; hold on;
     axis([0 20 -10 10]);
     drawLine(l1);
     drawCircle(c1);
     drawPoint(pts, 'rx');
     axis equal;

   See also
   lines2d, circles2d, intersectLines, intersectCircles

   References
   http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/
   http://mathworld.wolfram.com/Circle-LineIntersection.html




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
 Intersection point(s) of a line and a circle.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
intersectLineEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1024
INTERSECTLINEEDGE Return intersection between a line and an edge.

   P = intersectLineEdge(LINE, EDGE);
   returns the intersection point of lines LINE and edge EDGE. 
   LINE is a 1-by-4 array containing parametric representation of the line
   (in the form [x0 y0 dx dy], see 'createLine' for details). 
   EDGE is a 1-by-4 array containing the coordinates of first and second
   points (in the form [x1 y1 x2 y2], see 'createEdge' for details). 
   
   In case of colinear line and edge, returns [Inf Inf].
   If line does not intersect edge, returns [NaN NaN].

   If each input is N-by-4 array, the result is a N-by-2 array containing
   intersections for each couple of edge and line.
   If one of the input has N rows and the other 1 row, the result is a
   N-by-2 array.

   P = intersectLineEdge(LINE, EDGE, TOL);
   Specifies the tolerance option for determining if a point belongs to an
   edge and if lines are parallel.

   See also:
   lines2d, edges2d, intersectEdges, intersectLines




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
INTERSECTLINEEDGE Return intersection between a line and an edge.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1114
INTERSECTLINES Return all intersection points of N lines in 2D.

   PT = intersectLines(L1, L2);
   returns the intersection point of lines L1 and L2. L1 and L2 are 1-by-4
   row arrays, containing parametric representation of each line (in the
   form [x0 y0 dx dy], see 'createLine' for details).
   
   In case of colinear lines, returns [Inf Inf].
   In case of parallel but not colinear lines, returns [NaN NaN].

   If each input is [N*4] array, the result is a [N*2] array containing
   intersections of each couple of lines.
   If one of the input has N rows and the other 1 row, the result is a
   [N*2] array.

   PT = intersectLines(L1, L2, EPS);
   Specifies the tolerance for detecting parallel lines. Default is 1e-14.

   Example
   line1 = createLine([0 0], [10 10]);
   line2 = createLine([0 10], [10 0]);
   point = intersectLines(line1, line2)
   point = 
       5   5

   See also
   lines2d, edges2d, intersectEdges, intersectLineEdge
   intersectLineCircle

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
INTERSECTLINES Return all intersection points of N lines in 2D.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1113
 Compute the relative orientation of 3 points.

   CCW = isCounterClockwise(P1, P2, P3);
   Computes the orientation of the 3 points. The returns is:
   +1 if the path P1->P2->P3 turns Counter-Clockwise (i.e., the point P3
       is located "on the left" of the line P1-P2)
   -1 if the path turns Clockwise (i.e., the point P3 lies "on the right"
       of the line P1-P2) 
   0  if the point P3 is located on the line segment [P1 P2].

   This function can be used in more complicated algorithms: detection of
   line segment intersections, convex hulls, point in triangle...

   CCW = isCounterClockwise(P1, P2, P3, EPS);
   Specifies the threshold used for detecting colinearity of the 3 points.
   Default value is 1e-12 (absolute).

   Example
   isCounterClockwise([0 0], [10 0], [10 10])
   ans = 
       1
   isCounterClockwise([0 0], [0 10], [10 10])
   ans = 
       -1
   isCounterClockwise([0 0], [10 0], [5 0])
   ans = 
       0

   See also
   points2d, isPointOnLine, isPointInTriangle, polygonArea

   References
     Algorithm adapated from Sedgewick's book.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
 Compute the relative orientation of 3 points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 451
ISLEFTORIENTED Test if a point is on the left side of a line.

   B = isLeftOriented(POINT, LINE);
   Returns TRUE if the point lies on the left side of the line with
   respect to the line direction.
   
   If POINT is a NP-by-2 array, and/or LINE is a NL-by-4 array, the result
   is a NP-by-NL array containing the result for each point-line
   combination.

   See also:
   lines2d, points2d, isCounterClockwise, isPointOnLine, distancePointLine




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
ISLEFTORIENTED Test if a point is on the left side of a line.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 780
ISPARALLEL Check parallelism of two vectors.

   B = isParallel(V1, V2)
   where V1 and V2 are two row vectors of length ND, ND being the
   dimension, returns 1 if the vectors are parallel, and 0 otherwise.

   Also works when V1 and V2 are two N-by-ND arrays with same number of
   rows. In this case, return a N-by-1 array containing 1 at the positions
   of parallel vectors.

   Also works when one of V1 or V2 is N-by-1 and the other one is N-by-ND
   array, in this case return N-by-1 results.

   B = isParallel(V1, V2, ACCURACY)
   specifies the accuracy for numerical computation. Default value is
   1e-14. 
   

   Example
   isParallel([1 2], [2 4])
   ans =
       1
   isParallel([1 2], [1 3])
   ans =
       0

   See also
   vectors2d, isPerpendicular, lines2d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ISPARALLEL Check parallelism of two vectors.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 771
ISPERPENDICULAR Check orthogonality of two vectors.

   B = isPerpendicular(V1, V2)
   where V1 and V2 are two 1-by-2 row arrays, returns 1 if the vectors are
   perpendicular, and 0 otherwise.

   Also works when V1 and V2 are two N-by-2 arrays with same number of
   rows. In this case, return a N-by-1 array containing 1 at the positions
   of perpendicular vectors.

   Also works when one of V1 or V2 is 1-by-2 and the other one is a N-by-2
   array. In this case the result has size N-by-1.

   B = isPerpendicular(V1, V2, ACCURACY)
   specifies accuracy of numerical tests, default is 1e-14.


   Example
   isPerpendicular([1 2 1], [2 4 2])
   ans =
       1

   isPerpendicular([1 2 1], [1 3 2])
   ans =
       0

   See also
   vectors2d, isParallel, lines2d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ISPERPENDICULAR Check orthogonality of two vectors.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 637
ISPOINTINCIRCLE Test if a point is located inside a given circle.

   B = isPointInCircle(POINT, CIRCLE) 
   Returns true if point is located inside the circle, i.e. if distance to
   circle center is lower than the circle radius.

   B = isPointInCircle(POINT, CIRCLE, TOL) 
   Specifies the tolerance value

   Example:
   isPointInCircle([1 0], [0 0 1])
   isPointInCircle([0 0], [0 0 1])
   returns true, whereas
   isPointInCircle([1 1], [0 0 1])
   return false

   See also:
   circles2d, isPointOnCircle

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 07/04/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
ISPOINTINCIRCLE Test if a point is located inside a given circle.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 572
ISPOINTINELLIPSE Check if a point is located inside a given ellipse.

   B = isPointInEllipse(POINT, ELLIPSE) 
   Returns true if point is located inside the given ellipse.

   B = isPointInEllipse(POINT, ELLIPSE, TOL) 
   Specifies the tolerance value

   Example:
   isPointInEllipse([1 0], [0 0 2 1 0])
   ans =
       1
   isPointInEllipse([0 0], [0 0 2 1 0])
   ans =
       1
   isPointInEllipse([1 1], [0 0 2 1 0])
   ans =
       0
   isPointInEllipse([1 1], [0 0 2 1 30])
   ans =
       1

   See also:
     ellipses2d, isPointInCircle




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
ISPOINTINELLIPSE Check if a point is located inside a given ellipse.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
isPointInTriangle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1307
ISPOINTINTRIANGLE Test if a point is located inside a triangle.

   B = isPointInTriangle(POINT, V1, V2, V3)
   POINT is a 1-by-2 row vector containing coordinates of the test point,
   V1, V2 and V3 are 1-by-2 row vectors containing coordinates of triangle
   vertices. The function returns 1 is the point is inside or on the
   boundary of the triangle, and 0 otherwise.

   B = isPointInTriangle(POINT, VERTICES)
   Specifiy the coordinates of vertices as a 3-by-2 array.

   If POINT contains more than one row, the result B has as many rows as
   the input POINT.


   Example
     % vertices of the triangle
     p1 = [0 0];
     p2 = [10 0];
     p3 = [5 10];
     tri = [p1;p2;p3];
     % check if points are inside
     isPointInTriangle([0 0], tri)
     ans =
         1
     isPointInTriangle([5 5], tri)
     ans =
         1
     isPointInTriangle([10 5], tri)
     ans =
         0
     % check for an array of points
     isPointInTriangle([0 0;1 0;0 1], tri)
     ans =
         1
         1
         0

   See also
   polygons2d, isPointInPolygon, isCounterClockwise


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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
ISPOINTINTRIANGLE Test if a point is located inside a triangle.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 611
ISPOINTONCIRCLE Test if a point is located on a given circle.

   B = isPointOnCircle(POINT, CIRCLE) 
   return true if point is located on the circle, i.e. if the distance to
   the circle center equals the radius up to an epsilon value.

   B = isPointOnCircle(POINT, CIRCLE, TOL) 
   Specifies the tolerance value.

   Example:
   isPointOnCircle([1 0], [0 0 1])
   returns true, whereas
   isPointOnCircle([1 1], [0 0 1])
   return false

   See also:
   circles2d, isPointInCircle

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 07/04/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
ISPOINTONCIRCLE Test if a point is located on a given circle.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2007
ISPOINTONEDGE Test if a point belongs to an edge.

   Usage
   B = isPointOnEdge(POINT, EDGE)
   B = isPointOnEdge(POINT, EDGE, TOL)

   Description
   B = isPointOnEdge(POINT, EDGE)
   with POINT being [xp yp], and EDGE being [x1 y1 x2 y2], returns TRUE if
   the point is located on the edge, and FALSE otherwise.

   B = isPointOnEdge(POINT, EDGE, TOL)
   Specify an optilonal tolerance value TOL. The tolerance is given as a
   fraction of the norm of the edge direction vector. Default is 1e-14. 

   B = isPointOnEdge(POINTARRAY, EDGE)
   B = isPointOnEdge(POINT, EDGEARRAY)
   When one of the inputs has several rows, return the result of the test
   for each element of the array tested against the single parameter.

   B = isPointOnEdge(POINTARRAY, EDGEARRAY)
   When both POINTARRAY and EDGEARRAY have the same number of rows,
   returns a column vector with the same number of rows.
   When the number of rows are different and both greater than 1, returns
   a Np-by-Ne matrix of booleans, containing the result for each couple of
   point and edge.

   Examples
   % create a point array
   points = [10 10;15 10; 30 10];
   % create an edge array
   vertices = [10 10;20 10;20 20;10 20];
   edges = [vertices vertices([2:end 1], :)];

   % Test one point and one edge
   isPointOnEdge(points(1,:), edges(1,:))
   ans = 
       1
   isPointOnEdge(points(3,:), edges(1,:))
   ans = 
       0

   % Test one point and several edges
   isPointOnEdge(points(1,:), edges)'
   ans =
        1     0     0     1

   % Test several points and one edge
   isPointOnEdge(points, edges(1,:))'
   ans =
        1     1     0

   % Test N points and N edges
   isPointOnEdge(points, edges(1:3,:))'
   ans =
        1     0     0

   % Test NP points and NE edges
   isPointOnEdge(points, edges)
   ans =
        1     0     0     1
        1     0     0     0
        0     0     0     0


   See also
   edges2d, points2d, isPointOnLine




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ISPOINTONEDGE Test if a point belongs to an edge.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 570
ISPOINTONLINE Test if a point belongs to a line.

   B = isPointOnLine(POINT, LINE)
   with POINT being [xp yp], and LINE being [x0 y0 dx dy].
   Returns 1 if point lies on the line, 0 otherwise.

   If POINT is an N-by-2 array of points, B is a N-by-1 array of booleans.

   If LINE is a N-by-4 array of line, B is a 1-by-N array of booleans.

   B = isPointOnLine(POINT, LINE, TOL)
   Specifies the tolerance used for testing location on 3D line. Default value is 1e-14.

   See also: 
   lines2d, points2d, isPointOnEdge, isPointOnRay, isLeftOriented




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
ISPOINTONLINE Test if a point belongs to a line.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 823
ISPOINTONRAY Test if a point belongs to a ray.

   B = isPointOnRay(PT, RAY);
   Returns 1 if point PT belongs to the ray RAY.
   PT is given by [x y] and RAY by [x0 y0 dx dy].

   If PT is a N-by-2 array, and RAY is a M-by-4 array, then the result is
   a N-by-M array containing the result of each pair-wise test.

   B = isPointOnRay(PT, RAY, TOL);
   Specifies the tolerance to use for testing if point is on the ray.

   Example
     ray = [10 20 3 4];
     % test for a point on the ray
     p1 = [16 28]; 
     isPointOnRay(p1, ray)
     ans =
       logical
        0
     % test for a point on the supporting line but "before" the origin
     p2 = [7 16];
     isPointOnRay(p1, ray)
     ans =
       logical
        0
 
   See also:
   rays2d, points2d, isPointOnLine, isPointOnEdge




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ISPOINTONRAY Test if a point belongs to a ray.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 585
LINEANGLE Computes angle between two straight lines.

   A = lineAngle(LINE);
   Returns the angle between horizontal, right-axis and the given line.
   Angle is given in radians, between 0 and 2*pi, in counter-clockwise
   direction.

   A = lineAngle(LINE1, LINE2);
   Returns the directed angle between the two lines. Angle is given in
   radians between 0 and 2*pi, in counter-clockwise direction.

   See also
   lines2d, angles2d, createLine, normalizeAngle

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
LINEANGLE Computes angle between two straight lines.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
lineFit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 659
LINEFIT Fit a straight line to a set of points.

   L = lineFit(X, Y)
   Computes parametric line minimizing square error of all points (X,Y).
   Result is a 4*1 array, containing coordinates of a point of the line,
   and the direction vector of the line, that is  L=[x0 y0 dx dy];

   L = lineFit(PTS) 
   Gives coordinats of points in a single array.

   L = lineFit(PT0, PTS);
   L = lineFit(PT0, X, Y);
   with PT0 = [x0 y0], imposes the line to contain point PT0.

   Requires:
   Optimiaztion toolbox

   See also:
   lines2d, polyfit, polyfit2, lsqlin


   -----
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 30/04/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
LINEFIT Fit a straight line to a set of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1320
LINEPOSITION Position of a point on a line.

   POS = linePosition(POINT, LINE);
   Computes position of point POINT on the line LINE, relative to origin
   point and direction vector of the line.
   LINE has the form [x0 y0 dx dy],
   POINT has the form [x y], and is assumed to belong to line.

   POS = linePosition(POINT, LINES);
   If LINES is an array of NL lines, return NL positions, corresponding to
   each line.

   POS = linePosition(POINTS, LINE);
   If POINTS is an array of NP points, return NP positions, corresponding
   to each point.

   POS = linePosition(POINTS, LINES);
   If POINTS is an array of NP points and LINES is an array of NL lines,
   return an array of [NP NL] position, corresponding to each couple
   point-line.

   POS = linePosition(POINTS, LINES, 'diag');
   When POINTS and LINES have the same number of rows, computes positions
   only for couples POINTS(i,:) and LINES(i,:). The result POS is a column
   vector with as many rows as the number of points/lines.


   Example
   line = createLine([10 30], [30 90]);
   linePosition([20 60], line)
   ans =
       .5

   See also:
   lines2d, createLine, projPointOnLine, isPointOnLine

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 25/05/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
LINEPOSITION Position of a point on a line.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 455
LINETOEDGE Convert a straight line to a finite edge.

   EDGE = lineToEdge(LINE)
   Returns the edge with same origin as the line LINE, and with second
   extremity corresponding to the addition of line origin and direction.
   LINE is represented as [X0 Y0  DX DY]
   EDGE is represented as [X1 Y1  X2 Y2]

   Example
     line = [3 4  1 2];
     edge = lineToEdge(line)
     edge =
          3   4   4   6

   See also
     lines2d, edges2d, edgeToLine



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
LINETOEDGE Convert a straight line to a finite edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
lines2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 960
LINES2D  Description of functions operating on planar lines.

   The term 'line' refers to a planar straight line, which is an unbounded
   curve. Line segments defined between 2 points, which are bounded, are
   called 'edge', and are presented in file 'edges2d'.

   A straight line is defined by a point (its origin), and a vector (its
   direction). The parameters are bundled into a 1-by-4 row vector:
   LINE = [x0 y0 dx dy];

   A line contains all points (x,y) such that:
       x = x0 + t*dx
       y = y0 + t*dy;
   for all t between -infinity and +infinity.

   See also:
   points2d, vectors2d, edges2d, rays2d
   createLine, cartesianLine, medianLine, edgeToLine, lineToEdge
   orthogonalLine, parallelLine, bisector, radicalAxis
   lineAngle, linePosition, projPointOnLine
   isPointOnLine, distancePointLine, isLeftOriented
   intersectLines, intersectLineEdge, clipLine
   reverseLine, transformLine, drawLine
   lineFit



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
LINES2D  Description of functions operating on planar lines.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1213
MEDIANLINE Create a median line between two points.

   L = medianLine(P1, P2);
   Create the median line of points P1 and P2, that is the line containing
   all points located at equal distance of P1 and P2.

   L = medianLine(PTS);
   Creates the median line of 2 points, given as a 2*2 array. Array has
   the form:
   [ [ x1 y1 ] ; [ x2 y2 ] ]

   L = medianLine(EDGE);
   Creates the median of the edge. Edge is a 1*4 array, containing [X1 Y1]
   coordinates of first point, and [X2 Y2], the coordinates of the second
   point.
  
   Example
   % Draw the median line of two points
     P1 = [10 20];
     P2 = [30 50];
     med = medianLine(P1, P2);
     figure; axis square; axis([0 100 0 100]);
     drawEdge([P1 P2], 'linewidth', 2, 'color', 'k');
     drawLine(med)

   % Draw the median line of an edge
     P1 = [50 60];
     P2 = [80 30];
     edge = createEdge(P1, P2);
     figure; axis square; axis([0 100 0 100]);
     drawEdge(edge, 'linewidth', 2)
     med = medianLine(edge);
     drawLine(med)


   See also:
   lines2d, createLine, orthogonalLine

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
MEDIANLINE Create a median line between two points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 456
MERGEBOXES Merge two boxes, by computing their greatest extent.

   BOX = mergeBoxes(BOX1, BOX2);

   Example
   box1 = [5 20 5 30];
   box2 = [0 15 0 15];
   mergeBoxes(box1, box2)
   ans = 
       0 20 0 30


   See also
   boxes2d, drawBox, intersectBoxes


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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
MERGEBOXES Merge two boxes, by computing their greatest extent.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 717
MERGECLOSEPOINTS Merge points that are closer than a given distance.

   PTS2 = mergeClosePoints(PTS, DIST)
   Remove points in the array PTS such that no points closer than the
   distance DIST remain in the array.

   PTS2 = mergeClosePoints(PTS)
   If the distance is not specified, the default value 1e-14 is used.


   Example
     pts = rand(200, 2);
     pts2 = mergeClosePoints(pts, .1);
     figure; drawPoint(pts, '.');
     hold on; drawPoint(pts2, 'mo');

   See also
     points2d, removeMultipleVertices

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
MERGECLOSEPOINTS Merge points that are closer than a given distance.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
midPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 887
MIDPOINT Middle point of two points or of an edge.

   MID = midPoint(P1, P2)
   Compute the middle point of the two points P1 and P2.

   MID = midPoint(EDGE)
   Compute the middle point of the edge given by EDGE.
   EDGE has the format: [X1 Y1 X2 Y2], and MID has the format [XMID YMID],
   with XMID = (X1+X2)/2, and YMID = (Y1+Y2)/2.

   [MIDX MIDY] = midPoint(...)
   Return the result as two separate variables or arrays.

   Works also when EDGE is a N-by-4 array, in this case the result is a
   N-by-2 array containing the midpoint of each edge.


   Example
   P1 = [10 20];
   P2 = [30 40];
   midPoint([P1 P2])
   ans =
       20  30

   See also
   edges2d, points2d

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
MIDPOINT Middle point of two points or of an edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
minDistancePoints


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2615
 Minimal distance between several points.

   DIST = minDistancePoints(PTS)
   Returns the minimum distance between all pairs of points in PTS. PTS
   is a N-by-D array of values, N being the number of points and D the
   dimension of the points.

   DIST = minDistancePoints(PTS1, PTS2)
   Computes for each point in PTS1 the minimal distance to every point of
   PTS2. PTS1 and PTS2 are N-by-D arrays, where N is the number of points,
   and D is the dimension. Dimension must be the same for both arrays, but
   number of points can be different.
   The result is an array the same length as PTS1.


   DIST = minDistancePoints(..., NORM)
   Uses a user-specified norm. NORM=2 means euclidean norm (the default), 
   NORM=1 is the Manhattan (or "taxi-driver") distance.
   Increasing NORM growing up reduces the minimal distance, with a limit
   to the biggest coordinate difference among dimensions. 
   

   [DIST, I, J] = minDistancePoints(PTS)
   Returns indices I and J of the 2 points which are the closest. DIST
   verifies relation:
   DIST = distancePoints(PTS(I,:), PTS(J,:));

   [DIST, J] = minDistancePoints(PTS1, PTS2, ...)
   Also returns the indices of points which are the closest. J has the
   same size as DIST. It verifies relation: 
   DIST(I) = distancePoints(PTS1(I,:), PTS2(J,:));
   for I comprised between 1 and the number of rows in PTS1.


   Examples:
   % minimal distance between random planar points
       points = rand(20,2)*100;
       minDist = minDistancePoints(points);

   % minimal distance between random space points
       points = rand(30,3)*100;
       [minDist ind1 ind2] = minDistancePoints(points);
       minDist
       distancePoints(points(ind1, :), points(ind2, :))
   % results should be the same

   % minimal distance between 2 sets of points
       points1 = rand(30,2)*100;
       points2 = rand(30,2)*100;
       [minDists inds] = minDistancePoints(points1, points2);
       minDists(10)
       distancePoints(points1(10, :), points2(inds(10), :))
   % results should be the same
   
   % Find the (approximated) orthogonal projection onto an ellipse
     elli = [50 50 40 20 30];
     poly = ellipseToPolygon(elli, 200);
     figure; axis equal; axis([0 100 0 100]); hold on;
     drawPolygon(poly, 'k')
     pts = [20 20; 50 20; 80 30];
     [dists, inds] = minDistancePoints(pts, poly);
     drawPoint(pts, 'bo');
     drawPoint(poly(inds,:), 'ko');
     drawEdge([pts poly(inds,:)], 'k')
   

   See Also
     points2d, distancePoints, nndist, findClosestPoint, hausdorffDistance




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
 Minimal distance between several points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
nndist


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 991
NNDIST Nearest-neighbor distances of each point in a set.

   DISTS = nndist(POINTS)
   Returns the distance to the nearest neighbor of each point in an array
   of points.
   POINTS is an array of points, NP-by-ND.
   DISTS is a NP-by-1 array containing the distances to the nearest
   neighbor.

   This functions first computes the Delaunay triangulation of the set of
   points, then search for nearest distance in the set of each vertex
   neighbors. This reduces the overall complexity, but difference was
   noticed only for large sets (>10000 points)

   Example
     % Display Stienen diagram of a set of random points in unit square
     pts = rand(100, 2);
     [dists, inds] = nndist(pts);
     figure; drawPoint(pts, 'k.');
     hold on; drawCircle([pts dists/2], 'b');
     axis equal; axis([-.1 1.1 -.1 1.1]);
     % also display edges
     drawEdge([pts pts(inds, :)], 'b');

   See also
     points2d, distancePoints, minDistancePoints, findPoint




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
NNDIST Nearest-neighbor distances of each point in a set.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 313
NORMALIZE Normalize a vector.

   V2 = normalize(V);
   Returns the normalization of vector V, such that ||V|| = 1. V can be
   either a row or a column vector.

   When V is a MxN array, normalization is performed for each row of the
   array.

   See Also:
   vectors2d, normalizeVector, vectorNorm




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
NORMALIZE Normalize a vector.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 617
NORMALIZEANGLE  Normalize an angle value within a 2*PI interval.

   ALPHA2 = normalizeAngle(ALPHA);
   ALPHA2 is the same as ALPHA modulo 2*PI and is positive.

   ALPHA2 = normalizeAngle(ALPHA, CENTER);
   Specifies the center of the angle interval.
   If CENTER==0, the interval is [-pi ; +pi]
   If CENTER==PI, the interval is [0 ; 2*pi] (default).

   Example:
   % normalization between 0 and 2*pi (default)
   normalizeAngle(5*pi)
   ans =
       3.1416

   % normalization between -pi and +pi
   normalizeAngle(7*pi/2, 0)
   ans =
       -1.5708

   See also
   vectorAngle, lineAngle




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
NORMALIZEANGLE  Normalize an angle value within a 2*PI interval.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 564
NORMALIZEVECTOR Normalize a vector to have norm equal to 1.

   V2 = normalizeVector(V);
   Returns the normalization of vector V, such that ||V|| = 1. V can be
   either a row or a column vector.

   When V is a M-by-N array, normalization is performed for each row of
   the array.

   When V is a M-by-N-by-2 array, normalization is performed along the
   last dimension of the array.

   Example:
   vn = normalizeVector([3 4])
   vn =
       0.6000   0.8000
   vectorNorm(vn)
   ans =
       1

   See Also:
     vectors2d, vectorNorm




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
NORMALIZEVECTOR Normalize a vector to have norm equal to 1.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 651
ORIENTEDBOX Minimum-width oriented bounding box of a set of points.

   OBOX = orientedBox(PTS)
   Computes the oriented bounding box of a set of points. Oriented box is
   defined by a center, two dimensions (the length and the width), and the
   orientation of the length axis. Orientation is counted in degrees, 
   counter-clockwise.

   Example
     % Draw oriented bounding box of an ellipse
     elli = [30 40 40 20 30];
     pts = ellipseToPolygon(elli, 120);
     obox = orientedBox(pts);
     figure; hold on;
     drawEllipse(elli);
     drawOrientedBox(obox, 'm');

   See also
   drawOrientedBox, orientedBoxToPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
ORIENTEDBOX Minimum-width oriented bounding box of a set of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 718
ORIENTEDBOXTOPOLYGON Convert an oriented box to a polygon (set of vertices).

   POLY = orientedBoxToPolygon(OBOX);
   Converts the oriented box OBOX given either as [XC YC W H] or as 
   [XC YC W H THETA] into a 4-by-2 array of double, containing coordinates
   of box vertices. 
   XC and YC are center of the box. W and H are the width and the height
   (dimension in the main directions), and THETA is the orientation, in
   degrees between 0 and 360.

   Example
     OBOX = [20 10  40 20 0];
     RECT = orientedBoxToPolygon(OBOX)
     RECT =
         -20 -10 
          20 -10 
          20  10 
         -20  10 


   See also:
   polygons2d, orientedBox, drawOrientedBox, rectToPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
ORIENTEDBOXTOPOLYGON Convert an oriented box to a polygon (set of vertices).



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 873
ORTHOGONALLINE Create a line orthogonal to another one through a point.

   PERP = orthogonalLine(LINE, POINT);
   Returns the line orthogonal to the line LINE and going through the
   point given by POINT. Directed angle from LINE to PERP is pi/2.
   LINE is given as [x0 y0 dx dy] and POINT is [xp yp].

   Works also when LINE is a N-by-4 array, or POINT is a N-by-2 array. In
   this case, the result is a N-by-4 array.


 Example
     refLine = createLine([10 10], [30 20]);
     pt = [20 40];
     figure; hold on; axis equal; axis([0 50 0 50]);
     drawLine(refLine, 'lineWidth', 2);
     drawPoint(pt);
     perp = orthogonalLine(refLine, pt);
     drawLine(perp, 'color', 'r');
 
   See also:
   lines2d, parallelLine, intersectLines

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
ORTHOGONALLINE Create a line orthogonal to another one through a point.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 943
PARALLELEDGE Edge parallel to another edge.

   EDGE2 = parallelEdge(EDGE, DIST)
   Computes the edge parallel to the input edge EDGE and located at the
   given signed distance DIST.

   Example
     obox = [30 40 80 40 30];
     figure; hold on; axis equal;
     drawOrientedBox(obox, 'LineWidth', 2);
     edge1 = centeredEdgeToEdge(obox([1 2 3 5]));
     edge2 = centeredEdgeToEdge(obox([1 2 4 5])+[0 0 0 90]);
     drawEdge(edge1, 'LineWidth', 2, 'color', 'g');
     drawEdge(edge2, 'LineWidth', 2, 'color', 'g');
     drawEdge(parallelEdge(edge1, -30), 'LineWidth', 2, 'color', 'k');
     drawEdge(parallelEdge(edge2, -50), 'LineWidth', 2, 'color', 'k');

   See also
     edges2d, parallelLine, drawEdge, centeredEdgeToEdge, edgeToLine

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
PARALLELEDGE Edge parallel to another edge.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 973
PARALLELLINE Create a line parallel to another one.

   RES = parallelLine(LINE, POINT);
   Returns the line with same direction vector than LINE and going through
   the point given by POINT. 
   LINE is given as [x0 y0 dx dy] and POINT is [xp yp].


   RES = parallelLine(LINE, DIST);
   Uses relative distance to specify position. The new line will be
   located at distance DIST, counted positive in the right side of LINE
   and negative in the left side.

   Examples
     P1 = [20 30]; P2 = [50 10];
     L1 = createLine([50 10], [20 30]);
     figure; hold on; axis equal; axis([0 60 0 50]);
     drawPoint([P1; P2], 'ko');
     drawLine(L1, 'k');
     P = [30 40];
     drawPoint(P, 'ko');
     L2 = parallelLine(L1, P);
     drawLine(L2, 'Color', 'b');

   See also:
   lines2d, orthogonalLine, distancePointLine, parallelEdge

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 31/10/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
PARALLELLINE Create a line parallel to another one.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 545
POINTONLINE Create a point on a line at a given position on the line.

   P = pointOnLine(LINE, POS);
   Creates the point belonging to the line LINE, and located at the
   distance D from the line origin.
   LINE has the form [x0 y0 dx dy].
   LINE and D should have the same number N of rows. The result will have
   N rows ans 2 column (x and y positions).

   See also:
   lines2d, points2d, onLine, onLine, linePosition

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 07/04/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
POINTONLINE Create a point on a line at a given position on the line.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
points2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 585
POINTS2D  Description of functions operating on points.

   A point is defined by its two cartesian coordinate, put into a row
   vector of 2 elements:
   P = [x y];

   Several points are stored in a matrix with two columns, one for the
   x-coordinate, one for the y-coordinate.
   PTS = [x1 y1 ; x2 y2 ; x3 y3];
   
   Example
   P = [5 6];

   See also:
   centroid, midPoint, boundingBox, polarPoint
   distancePoints, minDistancePoints, nndist, circumCenter
   isCounterClockwise, angle2Points, angle3Points, angleSort
   transformPoint, clipPoints, drawPoint




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
POINTS2D  Description of functions operating on points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 773
POLARPOINT Create a point from polar coordinates (rho + theta).

   POINT = polarPoint(RHO, THETA);
   Creates a point using polar coordinate. THETA is angle with horizontal
   (counted counter-clockwise, and in radians), and RHO is the distance to
   origin.

   POINT = polarPoint(THETA)
   Specify angle, radius RHO is assumed to be 1.

   POINT = polarPoint(POINT, RHO, THETA)
   POINT = polarPoint(X0, Y0, RHO, THETA)
   Adds the coordinate of the point to the coordinate of the specified
   point. For example, creating a point with :
     P = polarPoint([10 20], 30, 2*pi);
   will give a result of [40 20].
   

   See Also:
   points2d

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 03/05/2004




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
POLARPOINT Create a point from polar coordinates (rho + theta).



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 610
POLYNOMIALTRANSFORM2D Apply a polynomial transform to a set of points.

   RES = polynomialTransform2d(PTS, COEFFS)
   Transforms the input points PTS given as a N-by-2 array of coordinates
   using the polynomial transform defined by PARAMS.
   PARAMS given as [a0 b0 a1 b1 ... an bn]

   Example
   coeffs = [0 0  1 0  0 1   0.1 0  0 0  0 0.1];
       %     cte   x    y     x^2   x*y   y^2
   pts = rand(200, 2) * 2 - 1;
   pts2 = polynomialTransform2d(pts, coeffs);
   figure; hold on;
   drawPoint(pts);
   drawPoint(pts2, 'g');

   See also
     transformPoint, fitPolynomialTransform2d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
POLYNOMIALTRANSFORM2D Apply a polynomial transform to a set of points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 853
PRINCIPALAXES Principal axes of a set of ND points.

   [CENTER, ROTMAT] = principalAxes(PTS)
   [CENTER, ROTMAT, SCALES] = principalAxes(PTS)
   Computes the principal axes of a set of points given in a N-by-ND array
   and returns the result in two or three outputs:
   CENTER  is the centroid of the points, as a 1-by-ND row vector
   ROTMAT  represents the orientation of the point cloud, as a ND-by-ND
           rotation matrix
   SCALES  is the scaling factor along each dimension, as a 1-by-ND row
           vector.

   Example
     pts = randn(100, 2);
     pts = transformPoint(pts, createScaling(5, 2));
     pts = transformPoint(pts, createRotation(pi/6));
     pts = transformPoint(pts, createTranslation(3, 4));
     [center, rotMat] = principalAxes(pts);

   See also
     equivalentEllipse, equivalentEllipsoid, principalAxesTransform




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
PRINCIPALAXES Principal axes of a set of ND points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 455
 Align a set of points along its principal axes.

   TRANSFO = principalAxesTransform(PTS)
   Computes the affine transform that will transform the input array PTS
   such that its principal axes become aligned with main axes.

   [TRANSFO, PTS2] = principalAxesTransform(PTS)
   Also returns the result of the transform applied to the points.

   Example
   principalAxesTransform

   See also
     principalAxes, equivalentEllipse, equivalentEllipsoid




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
 Align a set of points along its principal axes.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 756
PROJPOINTONLINE Project of a point orthogonally onto a line.

   PT2 = projPointOnLine(PT, LINE).
   Computes the (orthogonal) projection of point PT onto the line LINE.
   
   Function works also for multiple points and lines. In this case, it
   returns multiple points.
   Point PT1 is a [N*2] array, and LINE is a [N*4] array (see createLine
   for details). Result PT2 is a [N*2] array, containing coordinates of
   orthogonal projections of PT1 onto lines LINE.

   Example
     line = [0 2  2 1];
     projPointOnLine([3 1], line)
     ans = 
          2   3

   See also:
   lines2d, points2d, isPointOnLine, linePosition

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 07/04/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
PROJPOINTONLINE Project of a point orthogonally onto a line.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 674
RADICALAXIS Compute the radical axis (or radical line) of 2 circles.

   L = radicalAxis(C1, C2)
   Computes the radical axis of 2 circles.

   Example
   C1 = [10 10 5];
   C2 = [60 50 30];
   L = radicalAxis(C1, C2);
   hold on; axis equal;axis([0 100 0 100]); 
   drawCircle(C1);drawCircle(C2);drawLine(L);

   See also
   lines2d, circles2d, createCircle

   Ref:
   http://mathworld.wolfram.com/RadicalLine.html
   http://en.wikipedia.org/wiki/Radical_axis

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2007-05-15,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2007 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
RADICALAXIS Compute the radical axis (or radical line) of 2 circles.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 671
RANDOMPOINTINBOX Generate random point within a box.

   PTS = randomPointInBox(BOX)
   Generate a random point within the box BOX. The result is a 1-by-2 row
   vector.

   PTS = randomPointInBox(BOX, N)
   Generates N points within the box. The result is a N-by-2 array.

   BOX has the format:
   BOX = [xmin xmax ymin ymax].

   Example
     % draw points within a box
     box = [10 80 20 60];
     pts =  randomPointInBox(box, 500);
     figure(1); clf; hold on;
     drawBox(box);
     drawPoint(pts, '.');
     axis('equal');
     axis([0 100 0 100]);

   See also
     geom2d, points2d, boxes2d, randomPointInBox3d, randomPointInPolygon




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
RANDOMPOINTINBOX Generate random point within a box.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
rays2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 881
RAYS2D  Description of functions operating on planar rays.

   A ray is defined by a point (its origin), and a vector (its
   direction). The different parameters are bundled into a row vector:
   RAY = [x0 y0 dx dy];

   The ray contains all the points (x,y) such that:
   x = x0 + t*dx
   y = y0 + t*dy;
   for all t>0

   Contrary to a (straight) line, the points located before the origin do
   not belong to the ray.
   However, as rays and lines have the same representation, some functions
   working on lines are also working on rays (like 'transformLine').

   See also:
   points2d, vectors2d, lines2d
   createRay, bisector, isPointOnRay
   clipRay, drawRay

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2008-10-13,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2008 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
RAYS2D  Description of functions operating on planar rays.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 510
RECTTOBOX Convert rectangle data to box data.

   RECT = rectToBox(BOX)
   Converts from rectangle representation to box representation.
   BOX is given by [XMIN XMAX YMIN YMAX].
   RECT is given by [X0 Y0 WIDTH HEIGHT], with WIDTH and HEIGHT > 0

   Example
   rectToBox

   See also
   boxToRect, drawBox, drawRect

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
RECTTOBOX Convert rectangle data to box data.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 555
RECTTOPOLYGON Convert a rectangle into a polygon (set of vertices).

   POLY = rectToPolygon(RECT);
   Converts rectangle given as [X0 Y0 W H] or [X0 Y0 W H THETA] into a
   4-by-2 array double, containing coordinate of rectangle vertices.
   X0 and Y0 are the coordinates of the "lower left" vertex (before
   applying rotation), W and H are the width and the height of the
   rectangle, and THETA is the rotation angle around the first vertex, in
   degrees.

   See also:
   orientedBoxToPolygon, ellipseToPolygon, drawRect, drawPolygon





# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
RECTTOPOLYGON Convert a rectangle into a polygon (set of vertices).



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 672
REGISTERICP Fit affine transform by Iterative Closest Point algorithm.

   TRANS = registerICP(POINTS, TARGET)
   Computes the affine transform that maps the shape defines by POINTS
   onto the shape defined by the points TARGET. Both POINTS and TARGET are
   N-by-2 array of point coordinates, not necessarily the same size.
   The result TRANS is a 3-by-3 affine transform.

   TRANS = registerICP(POINTS, TARGET, NITER)
   Specifies the number of iterations for the algorithm.

   [TRANS, POINTS2] = registerICP(...)
   Also returns the set of transformed points.

   Example
   registerICP

   See also
     transforms2d, fitAffineTransform2d, registerPoints3dAffine




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
REGISTERICP Fit affine transform by Iterative Closest Point algorithm.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 458
REVERSEEDGE Intervert the source and target vertices of edge.

   REV = reverseEdge(EDGE);
   Returns the opposite edge of EDGE.
   EDGE has the format [X1 Y1 X2 Y2]. The resulting edge REV has value
   [X2 Y2 X1 Y1];

   See also:
   edges2d, createEdge, reverseLine

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
REVERSEEDGE Intervert the source and target vertices of edge.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 387
REVERSELINE Return same line but with opposite orientation.

   INVLINE = reverseLine(LINE);
   Returns the opposite line of LINE.
   LINE has the format [x0 y0 dx dy], then INVLINE will have following
   parameters: [x0 y0 -dx -dy].

   See also:
   lines2d, createLine

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 20/01/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
REVERSELINE Return same line but with opposite orientation.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 455
ROTATEVECTOR Rotate a vector by a given angle.

   VR = rotateVector(V, THETA)
   Rotate the vector V by an angle THETA, given in radians.

   Example
   rotateVector([1 0], pi/2)
   ans = 
       0   1

   See also
   vectors2d, transformVector, createRotation

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ROTATEVECTOR Rotate a vector by a given angle.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 554
SQUAREGRID Generate equally spaces points in plane.

   usage
   PTS = squareGrid(BOUNDS, ORIGIN, SIZE)
   generate points, lying in the window defined by BOUNDS (=[xmin ymin
   xmax ymax]), starting from origin with a constant step equal to size.
   
   Example
   PTS = squareGrid([0 0 10 10], [3 3], [4 2])
   will return points : 
   [3 1;7 1;3 3;7 3;3 5;7 5;3 7;7 7;3 9;7 9];



   TODO: add possibility to use rotated grid

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 06/08/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
SQUAREGRID Generate equally spaces points in plane.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 730
TRANSFORMEDGE Transform an edge with an affine transform.

   EDGE2 = transformEdge(EDGE1, TRANS);
   where EDGE1 has the form [x1 y1 x2 y1], and TRANS is a transformation
   matrix, return the edge transformed with affine transform TRANS. 

   Format of TRANS can be one of :
   [a b]   ,   [a b c] , or [a b c]
   [d e]       [d e f]      [d e f]
                            [0 0 1]

   EDGE2 = transformEdge(EDGES, TRANS); 
   Also wotk when EDGES is a [N*4] array of double. In this case, EDGE2
   has the same size as EDGE. 

   See also:
   edges2d, transforms2d, transformPoint, translation, rotation

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 06/04/2004.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
TRANSFORMEDGE Transform an edge with an affine transform.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 712
TRANSFORMLINE Transform a line with an affine transform.

   LINE2 = transformLine(LINE1, TRANS);
   returns the line LINE1 transformed with affine transform TRANS. 
   LINE1 has the form [x0 y0 dx dy], and TRANS is a transformation
   matrix.

   Format of TRANS can be one of :
   [a b]   ,   [a b c] , or [a b c]
   [d e]       [d e f]      [d e f]
                            [0 0 1]

   LINE2 = transformLine(LINES, TRANS);
   Also work when LINES is a [N*4] array of double. In this case, LINE2
   has the same size as LINE. 

   See also:
   lines2d, transforms2d, transformPoint

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 06/04/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
TRANSFORMLINE Transform a line with an affine transform.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 910
 Apply an affine transform to a point or a point set.

   PT2 = transformPoint(PT1, TRANSFO);
   Returns the result of the transformation TRANSFO applied to the point
   PT1. PT1 has the form [xp yp], and TRANSFO is either a 2-by-2, a
   2-by-3, or a 3-by-3 matrix, 

   Format of TRANSFO can be one of :
   [a b]   ,   [a b c] , or [a b c]
   [d e]       [d e f]      [d e f]
                            [0 0 1]

   PT2 = transformPoint(PT1, TRANSFO);
   Also works when PTA is a N-by-2 array representing point coordinates.
   In this case, the result PT2 has the same size as PT1.

   [X2, Y2] = transformPoint(X1, Y1, TRANS);
   Also works when PX1 and PY1 are two arrays the same size. The function
   transforms each pair (PX1, PY1), and returns the result in (X2, Y2),
   which has the same size as (PX1 PY1). 


   See also:
     points2d, transforms2d, translation, rotation




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
 Apply an affine transform to a point or a point set.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 980
TRANSFORMVECTOR Transform a vector with an affine transform.

   VECT2 = transformVector(VECT1, TRANS);
   where VECT1 has the form [xv yv], and TRANS is a [2*2], [2*3] or [3*3]
   matrix, returns the vector transformed with affine transform TRANS.

   Format of TRANS can be one of :
   [a b]   ,   [a b c] , or [a b c]
   [d e]       [d e f]      [d e f]
                            [0 0 1]

   VECT2 = transformVector(VECT1, TRANS);
   Also works when PTA is a [N*2] array of double. In this case, VECT2 has
   the same size as VECT1.

   [vx2 vy2] = transformVector(vx1, vy1, TRANS);
   Also works when vx1 and vy1 are arrays the same size. The function
   transform each couple of (vx1, vy1), and return the result in 
   (vx2, vy2), which is the same size as (vx1 vy1).


   See also:
   vectors2d, transforms2d, rotateVector, transformPoint

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 12/03/2007.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
TRANSFORMVECTOR Transform a vector with an affine transform.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1052
TRANSFORMS2D Description of functions operating on transforms.

   By 'transform' we mean an affine transform. A planar affine transform
   can be represented by a 3x3 matrix.

   Example
     % create a translation by the vector [10 20]:
     T = createTranslation([10 20])
     T =
          1     0    10
          0     1    20
          0     0     1

     % apply a rotation on a polygon
     poly = [0 0; 30 0;30 10;10 10;10 20;0 20];
     trans = createRotation([10 20], pi/6);
     polyT = transformPoint(poly, trans);
     % display the original and the rotated polygons
     figure; hold on; axis equal; axis([-10 40 -10 40]);
     drawPolygon(poly, 'k');
     drawPolygon(polyT, 'b');


   See also:
   createTranslation, createRotation, createRotation90, createScaling
   createHomothecy, createLineReflection, createBasisTransform
   transformPoint, transformVector, transformLine, transformEdge
   rotateVector, principalAxesTransform, fitAffineTransform2d
   polynomialTransform2d, fitPolynomialTransform2d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
TRANSFORMS2D Description of functions operating on transforms.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 861
TRIANGLEAREA Signed area of a triangle.

   AREA = triangleArea(P1, P2, P3)
   Computes area of the triangle whose vertices are given by P1, P2 and
   P3. Each vertex is a 1-by-2 row vector. 

   AREA = triangleArea(PTS)
   Concatenates vertex coordinates in a 3-by-2 array. Each row of the
   array contains coordinates of one vertex.


   Example
   % Compute area of a Counter-Clockwise (CCW) oriented triangle
     triangleArea([10 10], [30 10], [10 40])
     ans = 
         300

   % Compute area of a Clockwise (CW) oriented triangle
     triangleArea([10 40], [30 10], [10 10])
     ans = 
         -300

   See also
   polygonArea, triangleArea3d

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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
TRIANGLEAREA Signed area of a triangle.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 527
TRIANGLEGRID Generate triangular grid of points in the plane.

   usage
   PTS = triangleGrid(BOUNDS, ORIGIN, SIZE)
   generate points, lying in the window defined by BOUNDS, given in form
   [xmin ymin xmax ymax], starting from origin with a constant step equal
   to size. 
   SIZE is constant and is equals to the length of the sides of each
   triangles. 

   TODO: add possibility to use rotated grid

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 06/08/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
TRIANGLEGRID Generate triangular grid of points in the plane.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 863
 Horizontal angle of a vector, or angle between 2 vectors.

   A = vectorAngle(V);
   Returns angle between Ox axis and vector direction, in radians, in
   counter-clockwise orientation.
   The result is normalised between 0 and 2*PI.

   A = vectorAngle(V1, V2);
   Returns the angle from vector V1 to vector V2, in counter-clockwise
   order, in radians.

   A = vectorAngle(..., 'midAngle', MIDANGLE);
   Specifies convention for angle interval. MIDANGLE is the center of the
   2*PI interval containing the result. See <a href="matlab:doc
   ('normalizeAngle')">normalizeAngle</a> for details.

   Example:
   rad2deg(vectorAngle([2 2]))
   ans =
       45
   rad2deg(vectorAngle([1 sqrt(3)]))
   ans =
       60
   rad2deg(vectorAngle([0 -1]))
   ans =
       270
        
   See also:
     vectors2d, angles2d, normalizeAngle




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
 Horizontal angle of a vector, or angle between 2 vectors.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 595
 Compute norm of a vector, or of a set of vectors.

   N = vectorNorm(V);
   Returns the euclidean norm of vector V.

   N = vectorNorm(V, N);
   Specifies the norm to use. N can be any value greater than 0. 
   N=1 -> city lock norm
   N=2 -> euclidean norm
   N=inf -> compute max coord.

   When V is a MxN array, compute norm for each vector of the array.
   Vector are given as rows. Result is then a [M*1] array.

   Example
   n1 = vectorNorm([3 4])
   n1 =
       5

   n2 = vectorNorm([1, 10], inf)
   n2 =
       10

   See Also:
     vectors2d, vectorAngle




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
 Compute norm of a vector, or of a set of vectors.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 652
VECTORS2D Description of functions operating on plane vectors.

   A vector is defined by its two cartesian coordinates, put into a row
   vector of 2 elements:
   V = [vx vy];

   Several vectors are stored in a matrix with two columns, one for the
   x-coordinate, one for the y-coordinate.
   VS = [vx1 vy1 ; vx2 vy2 ; vx3 vy3];

   See also: 
   vectorNorm, vectorAngle, isPerpendicular, isParallel
   normalizeVector, transformVector, rotateVector


 ------
 Author: David Legland
 e-mail: david.legland@inra.fr
 Created: 2008-10-13,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2008 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
VECTORS2D Description of functions operating on plane vectors.





