Code covered by the BSD License
Highlights from
geom2d
 InterX(L1,varargin)
INTERX Intersection of curves
 angle2Points(varargin)
ANGLE2POINTS Compute horizontal angle between 2 points
 angle3Points(varargin)
ANGLE3POINTS Compute oriented angle made by 3 points
 angleAbsDiff(angle1, angl...ANGLEABSDIFF Absolute difference between two angles
 angleDiff(angle1, angle2)
ANGLEDIFF Difference between two angles
 angleSort(pts, varargin)
ANGLESORT Sort points in the plane according to their angle to origin
 angles2d
ANGLES2D Description of functions for manipulating angles
 bisector(varargin)
BISECTOR Return the bisector of two lines, or 3 points
 boundingBox(points)
BOUNDINGBOX Bounding box of a set of points
 boxToRect(box)
BOXTORECT Convert box data to rectangle data
 boxes2d(varargin)
BOXES2D Description of functions operating on bounding boxes
 cart2geod(src, curve)
CART2GEOD Convert cartesian coordinates to geodesic coord.
 cartesianLine(varargin)
CARTESIANLINE Create a straight line from cartesian equation coefficients
 centeredEdgeToEdge(cedge)
CENTEREDEDGETOEDGE Convert a centered edge to a twopoints edge
 centroid(varargin)
CENTROID Compute centroid (center of mass) of a set of points
 circleArcAsCurve(arc, N)
CIRCLEARCASCURVE Convert a circle arc into a series of points
 circleArcToPolyline(arc, N)
CIRCLEARCTOPOLYLINE Convert a circle arc into a series of points
 circleAsPolygon(circle, v...CIRCLEASPOLYGON Convert a circle into a series of points
 circleToPolygon(circle, v...CIRCLETOPOLYGON Convert a circle into a series of points
 circles2d(varargin)
CIRCLES2D Description of functions operating on circles
 circumCenter(a, b, c)
CIRCUMCENTER Circumcenter of three points
 circumCircle(varargin)
CIRCUMCIRCLE Circumscribed circle of three points
 clipEdge(edge, box)CLIPEDGE Clip an edge with a rectangular box
 clipLine(line, box, varar...CLIPLINE Clip a line with a box
 clipLineRect(line, rect)
CLIPLINERECT clip a line with a polygon
 clipPoints(points, box)
CLIPPOINTS Clip a set of points by a box
 clipPolygon(polygon, w)CLIPPOLYGON Clip a polygon with a rectangular box
 clipPolygonHP(poly, line)CLIPPOLYGONHP Clip a polygon with a Halfplane defined by a directed line
 clipRay(ray, box)
 contourMatrixToPolylines(C)
CONTOURMATRIXTOPOLYLINES Converts a contour matrix array into a polyline set
 convexHull(points)
CONVEXHULL Convex hull of a set of points
 convexification(varargin)
CONVEXIFICATION Compute the convexification of a polygon
 crackPattern(box, points,...CRACKPATTERN Create a (bounded) crack pattern tessellation
 crackPattern2(box, points...CRACKPATTERN2 Create a (bounded) crack pattern tessellation
 createBasisTransform(sour...CREATEBASISTRANSFORM Compute matrix for transforming a basis into another basis
 createCircle(varargin)
CREATECIRCLE Create a circle from 2 or 3 points
 createDirectedCircle(vara...CREATEDIRECTEDCIRCLE Create a directed circle
 createEdge(varargin)
CREATEEDGE Create an edge between two points, or from a line
 createHomothecy(point, ra...CREATEHOMOTHECY Create the the 3x3 matrix of an homothetic transform
 createLine(varargin)
CREATELINE Create a straight line from 2 points, or from other inputs
 createLineReflection(line)
CREATELINEREFLECTION Create the the 3x3 matrix of a line reflection
 createMedian(varargin)
CREATEMEDIAN create a median line
 createRay(varargin)
CREATERAY Create a ray (halfline), from various inputs
 createRotation(varargin)
CREATEROTATION Create the 3*3 matrix of a rotation
 createRotation90(varargin)
CREATEROTATION90 Matrix of a rotation for 90 degrees multiples
 createScaling(varargin)
CREATESCALING Create the 3*3 matrix of a scaling in 2 dimensions
 createTranslation(varargin)
CREATETRANSLATION Create the 3*3 matrix of a translation
 createVector(p1, p2)
CREATEVECTOR Create a vector from two points
 cubicBezierToPolyline(poi...CUBICBEZIERTOPOLYLINE Compute equivalent polyline from bezier curve control
 curvature(varargin)
CURVATURE Estimate curvature of a polyline defined by points
 curveCMoment(curve, p, q)
CURVECMOMENT Compute centered inertia moment of a 2D curve
 curveCSMoment(curve, p, q)
CURVECSMOMENT Compute centered scaled moment of a 2D curve
 curveCentroid(varargin)
CURVECENTROID compute centroid of a curve defined by a series of points
 curveLength(varargin)
CURVELENGTH return length of a curve (a list of points)
 curveMoment(curve, p, q)
CURVEMOMENT Compute inertia moment of a 2D curve
 deg2rad(deg)DEG2RAD Convert angle from degrees to radians
 densifyPolygon(poly, N)
DENSIFYPOLYGON Add several points on each edge of the polygon
 distancePointEdge(point, ...DISTANCEPOINTEDGE Minimum distance between a point and an edge
 distancePointLine(point, ...DISTANCEPOINTLINE Minimum distance between a point and a line
 distancePointPolygon(poin...DISTANCEPOINTPOLYGON Shortest distance between a point and a polygon
 distancePointPolyline(poi...DISTANCEPOINTPOLYLINE Compute shortest distance between a point and a polyline
 distancePoints(p1, p2, va...DISTANCEPOINTS Compute distance between two points
 distancePolygons(poly1, p...DISTANCEPOLYGONS Compute the shortest distance between 2 polygons
 distancePolylines(poly1, ...DISTANCEPOLYLINES Compute the shortest distance between 2 polylines
 drawArrow(varargin)
DRAWARROW Draw an arrow on the current axis
 drawBezierCurve(points, v...DRAWBEZIERCURVE Draw a cubic bezier curve defined by 4 control points
 drawBox(box, varargin)
DRAWBOX Draw a box defined by coordinate extents
 drawCenteredEdge(varargin)
DRAWCENTEREDEDGE Draw an edge centered on a point
 drawCircle(varargin)
DRAWCIRCLE Draw a circle on the current axis
 drawCircleArc(varargin)
DRAWCIRCLEARC Draw a circle arc on the current axis
 drawCurve(varargin)
DRAWCURVE draw a curve specified by a list of points
 drawEdge(varargin)
DRAWEDGE Draw an edge given by 2 points
 drawEllipse(varargin)
DRAWELLIPSE Draw an ellipse on the current axis
 drawEllipseArc(varargin)
DRAWELLIPSEARC Draw an ellipse arc on the current axis
 drawLabels(varargin)
DRAWLABELS Draw labels at specified positions
 drawLine(lin, varargin)
DRAWLINE Draw a straight line clipped by the current axis
 drawOrientedBox(box, vara...DRAWORIENTEDBOX Draw centered oriented rectangle
 drawParabola(varargin)
DRAWPARABOLA Draw a parabola on the current axis
 drawPoint(varargin)
DRAWPOINT Draw the point on the axis.
 drawPolygon(varargin)
DRAWPOLYGON Draw a polygon specified by a list of points
 drawPolyline(varargin)
DRAWPOLYLINE Draw a polyline specified by a list of points
 drawPolynomialCurve(tBoun...DRAWPOLYNOMIALCURVE Draw a polynomial curve approximation
 drawRay(ray, varargin)
DRAWRAY Draw a ray on the current axis
 drawRect(rect, varargin)
DRAWRECT Draw rectangle on the current axis
 drawRect2(varargin)
DRAWRECT2 Draw centered rectangle on the current axis
 drawShape(type, param, va...DRAWSHAPE Draw various types of shapes (circles, polygons...)
 drawVector(pos, vect, var...DRAWVECTOR Draw vector at a given position
 drawVertices(varargin)
DRAWVERTICES Draw the vertices of a polygon or polyline
 edgeAngle(edge)
EDGEANGLE Return angle of edge
 edgeLength(varargin)
EDGELENGTH Return length of an edge
 edgePosition(point, edge)
EDGEPOSITION Return position of a point on an edge
 edgeToLine(edge)
EDGETOLINE Convert an edge to a straight line
 edgeToPolyline(edge, N)
EDGETOPOLYLINE Convert an edge to a polyline with a given number of segments
 edges2d(varargin)
EDGES2D Description of functions operating on planar edges
 ellipseAsPolygon(ellipse,...ELLIPSEASPOLYGON Convert an ellipse into a series of points
 ellipsePerimeter(ellipse,...ELLIPSEPERIMETER Perimeter of an ellipse
 ellipseToPolygon(ellipse,...ELLIPSETOPOLYGON Convert an ellipse into a series of points
 ellipses2d(varargin)
ELLIPSES2D Description of functions operating on ellipses
 enclosingCircle(pts)
ENCLOSINGCIRCLE Find the minimum circle enclosing a set of points.
 expandPolygon(poly, dist,...EXPANDPOLYGON Expand a polygon by a given (signed) distance
 fillPolygon(varargin)
FILLPOLYGON Fill a polygon specified by a list of points
 findPoint(coord, points)
FINDPOINT Find index of a point in an set from its coordinates
 fitAffineTransform2d(pts1...FITAFFINETRANSFORM2D Fit an affine transform using two point sets
 fitPolynomialTransform2d(...FITPOLYNOMIALTRANSFORM2D Coefficients of polynomial transform between two point sets
 formatAngle(alpha)
FORMATANGLE Ensure an angle value is comprised between 0 and 2*PI
 geod2cart(src, curve, nor...GEOD2CART Convert geodesic coordinates to cartesian coord.
 hausdorffDistance(pts1, p...HAUSDORFFDISTANCE Hausdorff distance between two point sets
 hexagonalGrid(bounds, ori...HEXAGONALGRID Generate hexagonal grid of points in the plane.
 homothecy(point, ratio)
HOMOTHECY create a homothecy as an affine transform
 inCircle(point, circle)
INCIRCLE test if a point is located inside a given circle.
 inertiaEllipse(points)
INERTIAELLIPSE Inertia ellipse of a set of points
 intersectBoxes(box1, box2)
INTERSECTBOXES Intersection of two bounding boxes
 intersectCircles(circle1,...INTERSECTCIRCLES Intersection points of two circles
 intersectEdgePolygon(edge...INTERSECTEDGEPOLYGON Intersection point of an edge with a polygon
 intersectEdges(edge1, edg...INTERSECTEDGES Return all intersections between two set of edges
 intersectLineCircle(line,...INTERSECTLINECIRCLE Intersection point(s) of a line and a circle
 intersectLineEdge(line, e...INTERSECTLINEEDGE Return intersection between a line and an edge
 intersectLinePolygon(line...INTERSECTLINEPOLYGON Intersection points between a line and a polygon
 intersectLinePolyline(lin...INTERSECTLINEPOLYLINE Intersection points between a line and a polyline
 intersectLines(line1, lin...INTERSECTLINES Return all intersection points of N lines in 2D
 intersectPolylines(poly1,...INTERSECTPOLYLINES Find the common points between 2 polylines
 intersectRayPolygon(ray, ...INTERSECTRAYPOLYGON Intersection points between a ray and a polygon
 invertLine(var)
INVERTLINE return same line but with opposite orientation
 isAxisHandle(arg)
ISAXISHANDLE Check if the input corresponds to a valid axis hanfle
 isCounterClockwise(p1, p2...ISCOUNTERCLOCKWISE Compute relative orientation of 3 points
 isLeftOriented(point, line)ISLEFTORIENTED Test if a point is on the left side of a line
 isParallel(v1, v2, varargin)ISPARALLEL Check parallelism of two vectors
 isPerpendicular(v1, v2, v...ISPERPENDICULAR Check orthogonality of two vectors
 isPointInCircle(point, ci...ISPOINTINCIRCLE Test if a point is located inside a given circle
 isPointInEllipse(point, e...ISPOINTINELLIPSE Check if a point is located inside a given ellipse
 isPointInPolygon(point, p...ISPOINTINPOLYGON Test if a point is located inside a polygon
 isPointInTriangle(point, ...ISPOINTINTRIANGLE Test if a point is located inside a triangle
 isPointOnCircle(point, ci...ISPOINTONCIRCLE Test if a point is located on a given circle.
 isPointOnEdge(point, edge...ISPOINTONEDGE Test if a point belongs to an edge
 isPointOnLine(point, line...ISPOINTONLINE Test if a point belongs to a line
 isPointOnPolyline(point, ...ISPOINTONPOLYLINE Test if a point belongs to a polyline
 isPointOnRay(point, ray, ...ISPOINTONRAY Test if a point belongs to a ray
 lineAngle(varargin)
LINEANGLE Computes angle between two straight lines
 lineFit(varargin)LINEFIT Fit a straight line to a set of points
 linePosition(point, line,...LINEPOSITION Position of a point on a line
 lineSymmetry(line)
LINESYMMETRY create line symmetry as 2D affine transform
 lines2d(varargin)
LINES2D Description of functions operating on planar lines
 medialAxisConvex(points)
MEDIALAXISCONVEX Compute medial axis of a convex polygon
 medianLine(varargin)
MEDIANLINE Create a median line between two points
 mergeBoxes(box1, box2)
MERGEBOXES Merge two boxes, by computing their greatest extent
 mergeClosePoints(points, ...MERGECLOSEPOINTS Merge points that are closer than a given distance
 midPoint(varargin)
MIDPOINT Middle point of two points or of an edge
 minDistance(p, curve)
MINDISTANCE compute minimum distance between a point and a set of points
 minDistancePoints(p1, var...MINDISTANCEPOINTS Minimal distance between several points
 minimumCaliperDiameter(po...MINIMUMCALIPERDIAMETER Minimum caliper diameter of a set of points
 nndist(points)
NNDIST Nearestneighbor distances of each point in a set
 normalize(v)
NORMALIZE normalize a vector
 normalizeAngle(alpha, var...NORMALIZEANGLE Normalize an angle value within a 2*PI interval
 normalizeVector(v)
NORMALIZEVECTOR Normalize a vector to have norm equal to 1
 onCircle(point, circle)
ONCIRCLE test if a point is located on a given circle.
 onEdge(point, edge)
ONEDGE test if a point belongs to an edge
 onLine(point, line)
ONLINE test if a point belongs to a line
 onRay(point, ray)
ONRAY test if a point belongs to a ray
 orientedBox(points)
ORIENTEDBOX Minimumwidth oriented bounding box of a set of points
 orientedBoxToPolygon(obox)
ORIENTEDBOXTOPOLYGON Convert an oriented box to a polygon (set of vertices)
 orthogonalLine(line, point)
ORTHOGONALLINE Create a line orthogonal to another one through a point
 parallelEdge(edge, dist)
PARALLELEDGE Edge parallel to another edge
 parallelLine(line, point)
PARALLELLINE Create a line parallel to another one.
 parametrize(varargin)
PARAMETRIZE Parametrization of a polyline, based on edges lengths
 parseThreePoints(varargin)
PARSETHREEPOINTS Parse three points from variable length input array
 pointOnLine(line, pos)
POINTONLINE Create a point on a line at a given position on the line
 pointSetsAverage(pointSet...POINTSETSAVERAGE Compute the average of several point sets
 points2d
POINTS2D Description of functions operating on points
 polarPoint(varargin)
POLARPOINT Create a point from polar coordinates (rho + theta)
 polyfit2(varargin)POLYFIT2 Polynomial approximation of a curve
 polygonArea(poly, varargin)
POLYGONAREA Compute the signed area of a polygon
 polygonBounds(polygon)
POLYGONBOUNDS Compute the bounding box of a polygon
 polygonCentroid(varargin)
POLYGONCENTROID Compute the centroid (center of mass) of a polygon
 polygonContains(poly, poi...POLYGONCONTAINS Test if a point is contained in a multiply connected polygon
 polygonExpand(polygon, dist)POLYGONEXPAND 'expand' a polygon with a given distance
 polygonLength(poly, varar...POLYGONLENGTH Perimeter of a polygon
 polygonLoops(poly)
POLYGONLOOPS Divide a possibly selfintersecting polygon into a set of simple loops
 polygonNormalAngle(points...POLYGONNORMALANGLE Compute the normal angle at a vertex of the polygon
 polygonPoint(poly, pos)
POLYGONPOINT Extract a point from a polygon
 polygonSelfIntersections(...POLYGONSELFINTERSECTIONS Find selfintersection points of a polygon
 polygonSignature(poly, va...POLYGONSIGNATURE Polar signature of a polygon (polar distance to origin)
 polygonSubcurve(poly, t0,...POLYGONSUBCURVE Extract a portion of a polygon
 polygonToRow(polygon, var...POLYGONTOROW Convert polygon coordinates to a row vector
 polylineCentroid(varargin)
POLYLINECENTROID Compute centroid of a curve defined by a series of points
 polylineLength(poly, vara...POLYLINELENGTH Return length of a polyline given as a list of points
 polylinePoint(poly, pos)
POLYLINEPOINT Extract a point from a polyline
 polylineSelfIntersections...POLYLINESELFINTERSECTIONS Find selfintersection points of a polyline
 polylineSubcurve(poly, t0...POLYLINESUBCURVE Extract a portion of a polyline
 polynomialCurveCentroid(t...POLYNOMIALCURVECENTROID Compute the centroid of a polynomial curve
 polynomialCurveCurvature(...POLYNOMIALCURVECURVATURE Compute the local curvature of a polynomial curve
 polynomialCurveCurvatures...POLYNOMIALCURVECURVATURES Compute curvatures of a polynomial revolution surface
 polynomialCurveDerivative...POLYNOMIALCURVEDERIVATIVE Compute derivative vector of a polynomial curve
 polynomialCurveFit(t, var...POLYNOMIALCURVEFIT Fit a polynomial curve to a series of points
 polynomialCurveLength(tBo...POLYNOMIALCURVELENGTH Compute the length of a polynomial curve
 polynomialCurveNormal(t, ...POLYNOMIALCURVENORMAL Compute the normal of a polynomial curve
 polynomialCurvePoint(t, v...POLYNOMIALCURVEPOINT Compute point corresponding to a position
 polynomialCurvePosition(t...POLYNOMIALCURVEPOSITION Compute position on a curve for a given length
 polynomialCurveProjection...POLYNOMIALCURVEPROJECTION Projection of a point on a polynomial curve
 polynomialCurveSetFit(seg...POLYNOMIALCURVESETFIT Fit a set of polynomial curves to a segmented image
 polynomialDerivate(poly)
POLYNOMIALDERIVATE Derivate a polynomial
 polynomialTransform2d(pts...POLYNOMIALTRANSFORM2D Apply a polynomial transform to a set of points
 projPointOnLine(point, li...PROJPOINTONLINE Project of a point orthogonally onto a line
 projPointOnPolygon(point,...PROJPOINTONPOLYGON Compute position of a point projected on a polygon
 projPointOnPolyline(point...PROJPOINTONPOLYLINE Compute position of a point projected on a polyline
 rad2deg(rad)RAD2DEG Convert angle from radians to degrees
 radicalAxis(circle1, circ...RADICALAXIS Compute the radical axis (or radical line) of 2 circles
 randomPointInBox(box, N, ...RANDOMPOINTINBOX Generate random point within a box
 rays2d(varargin)
RAYS2D Description of functions operating on planar rays
 readPolygonSet(filename)
READPOLYGONSET Read a set of simple polygons stored in a file
 rectAsPolygon(rect)
RECTASPOLYGON Convert a (centered) rectangle into a series of points
 rectToBox(rect)
RECTTOBOX Convert rectangle data to box data
 rectToPolygon(rect)
RECTTOPOLYGON Convert a rectangle into a polygon (set of vertices)
 removeMultipleVertices(po...REMOVEMULTIPLEVERTICES Remove multiple vertices of a polygon or polyline
 resamplePolygon(poly, n)
RESAMPLEPOLYGON Distribute N points equally spaced on a polygon
 resamplePolyline(poly, n)
RESAMPLEPOLYLINE Distribute N points equally spaced on a polyline
 reverseEdge(edge)
REVERSEEDGE Intervert the source and target vertices of edge
 reverseLine(line)
REVERSELINE Return same line but with opposite orientation
 reversePolygon(poly)
REVERSEPOLYGON Reverse a polygon, by iterating vertices from the end
 reversePolyline(poly)
REVERSEPOLYLINE Reverse a polyline, by iterating vertices from the end
 rotateVector(v, angle)
ROTATEVECTOR Rotate a vector by a given angle
 rotation(varargin)
ROTATION return 3*3 matrix of a rotation
 rowToPolygon(row, varargin)
ROWTOPOLYGON Create a polygon from a row vector
 scaling(varargin)
SCALING return 3*3 matrix of a scaling in 2 dimensions
 simplifyPolygon(poly, var...SIMPLIFYPOLYGON DouglasPeucker simplification of a polygon
 simplifyPolyline(poly, tol)
SIMPLIFYPOLYLINE DouglasPeucker simplification of a polyline
 splitPolygons(polygon)
SPLITPOLYGONS Convert a NaN separated polygon list to a cell array of polygons
 squareGrid(bounds, origin...SQUAREGRID Generate equally spaces points in plane.
 steinerPoint(varargin)
STEINERPOINT Compute steiner point (weighted centroid) of a polygon
 steinerPolygon(points)STEINERPOLYGON Create a Steiner polygon from a set of vectors
 subCurve(curve, P1, P2, v...SUBCURVE extract a portion of a curve
 supportFunction(polygon, ...SUPPORTFUNCTION Compute support function of a polygon
 transformEdge(edge, trans)
TRANSFORMEDGE Transform an edge with an affine transform
 transformLine(line, trans)
TRANSFORMLINE Transform a line with an affine transform
 transformPoint(varargin)
TRANSFORMPOINT Transform a point with an affine transform
 transformVector(varargin)
TRANSFORMVECTOR Transform a vector with an affine transform
 transforms2d(varargin)
TRANSFORMS2D Description of functions operating on transforms
 translation(varargin)
TRANSLATION return 3*3 matrix of a translation
 triangleArea(pt1, pt2, pt3)
TRIANGLEAREA Signed area of a triangle
 triangleGrid(bounds, orig...TRIANGLEGRID Generate triangular grid of points in the plane.
 triangulatePolygon(poly)
TRIANGULATEPOLYGON Compute a triangulation of the polygon
 vecnorm(v, varargin)
VECNORM compute norm of vector or of set of vectors
 vectorAngle(v1, varargin)
VECTORANGLE Angle of a vector, or between 2 vectors
 vectorNorm(v, varargin)
VECTORNORM Compute norm of a vector, or of a set of vectors
 vectors2d
VECTORS2D Description of functions operating on plane vectors
 writePolygonSet(polys, fi...WRITEPOLYGONSET Write a set of simple polygons into a file
 Contents.mPOLYGONS Manipulation of planar polygons and polylines
 Contents.mPOLYNOMIALCURVES2D Planar Polynomial Curves
 Contents.mGEOM2D Geometry 2D Toolbox

View all files
geom2d
by
David Legland
13 Jun 2005
(Updated
01 Apr 2014)
Geometry library for matlab. Performs geometric computations on points, lines, circles, polygons...

Contents.m 
% GEOM2D Geometry 2D Toolbox
% Version 1.0 21Mar2011 .
%
% Library to handle and visualize geometric primitives such as points,
% lines, circles and ellipses, polygons...
%
% The goal is to provide a lowlevel 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 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  Transform a point with an affine transform
% 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
% angleSort  Sort points in the plane according to their angle to origin
% minDistancePoints  Minimal distance between several points
% mergeClosePoints  Merge points that are closer than a given distance
% hausdorffDistance  Hausdorff distance between two point sets
% nndist  Nearestneighbor 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  Angle of a vector, or 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.
% 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
% 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
% edgeToLine  Convert an edge to a straight 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 twopoints 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
% 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 (halfline), 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
% inertiaEllipse  Inertia 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
% fitAffineTransform2d  Fit an affine transform using two point sets
% 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
% deg2rad  Convert angle from degrees to radians
% rad2deg  Convert angle from radians to degrees
%
% 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
% 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  Minimumwidth 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...)
% isAxisHandle  Check if the input corresponds to a valid axis hanfle
%
% 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
% email: david.legland@grignon.inra.fr
% Created: 20051107
% Copyright INRA  Cepia Software Platform.
% Project homepage: http://matgeom.sourceforge.net/
% http://www.pflcepia.inra.fr/index.php?page=geom2d
help('Contents');
%% Deprecated functions
% createMedian  create a median line
% minDistance  compute minimum distance between a point and a set of points
% homothecy  create a homothecy as an affine transform
% rotation  return 3*3 matrix of a rotation
% translation  return 3*3 matrix of a translation
% scaling  return 3*3 matrix of a scaling in 2 dimensions
% lineSymmetry  create line symmetry as 2D affine transform
% vecnorm  compute norm of vector or of set of vectors
% normalize  normalize a vector
% onCircle  test if a point is located on a given circle.
% inCircle  test if a point is located inside a given circle.
% onEdge  test if a point belongs to an edge
% onLine  test if a point belongs to a line
% onRay  test if a point belongs to a ray
% invertLine  return same line but with opposite orientation
% clipLineRect  clip a line with a polygon
% formatAngle  Ensure an angle value is comprised between 0 and 2*PI
% drawRect2  Draw centered rectangle on the current axis
% circleAsPolygon  Convert a circle into a series of points
% circleArcAsCurve  Convert a circle arc into a series of points
% ellipseAsPolygon  Convert an ellipse into a series of points
%% Others...


Contact us