Mathematics > Computational Geometry
84 functions in MATLAB › Mathematics > Computational Geometry.
Elementary Polygons
addboundary | Adds a new polygonal boundary to a polyshape and returns the combined shape. |
boundingbox | Smallest axis-aligned rectangle that contains a polyshape. |
centroid | Center of mass of a polyshape, treated as a uniform plate. |
holes | Returns the holes of a polyshape as an array of polyshape objects. |
inpolygon | Tests which points lie inside or on the edge of a polygon. |
ishole | Tells which boundaries of a polyshape are holes. |
isinterior | Tests whether points lie inside a polyshape. |
issimplified | Tests whether a polyshape is free of self-intersections and other defects. |
nearestvertex | Index of the polyshape vertex closest to each query point. |
nsidedpoly | Creates a regular polygon with a given number of sides, as a polyshape. |
numboundaries | Number of boundaries of a polyshape, counting outer boundaries and holes. |
numsides | Total number of sides (vertices) of a polyshape. |
overlaps | Tests whether two polyshapes share any area. |
polyarea | Area of a polygon given by its vertex coordinates. |
polybuffer | Grows or shrinks a polyshape by a fixed distance. |
polyshape | Creates a 2-D polygon, possibly with several regions and holes, that supports geometry queries and Boolean operations. |
rectint | Area of intersection between axis-aligned rectangles. |
regions | Splits a polyshape into its disconnected regions. |
rmboundary | Removes selected boundaries from a polyshape. |
rmholes | Removes holes from a polyshape, leaving solid regions. |
rmslivers | Removes thin parts of a polyshape narrower than a given width. |
rotate | Rotates a polyshape by an angle in degrees about a center point. |
scale | Scales a polyshape by a factor, about a center point. |
sortboundaries | Reorders the boundaries of a polyshape by a chosen criterion. |
sortregions | Reorders the regions of a polyshape by a chosen criterion. |
subtract | Boolean difference of two polyshapes: the first with the second cut out. |
translate | Shifts a polyshape by a given offset in x and y. |
turningdist | Turning-function distance between two polyshape boundaries. |
Bounding Regions
alphaShape | Creates a bounding region around a set of 2-D or 3-D points, controlled by a radius alpha. |
alphaSpectrum | Alpha values at which the alpha shape changes its set of triangles or tetrahedra. |
alphaTriangulation | Triangles or tetrahedra that make up an alpha shape, with the point coordinates. |
area | Area of a polyshape or a 2-D alpha shape (a 3-D alpha shape has volume instead). |
boundary | Boundary of a set of 2-D or 3-D points, between the convex hull and a tight outline. |
boundaryFacets | Boundary edges (2-D) or faces (3-D) of an alpha shape. |
convhull | Convex hull of a set of 2-D or 3-D points. |
convhulln | Convex hull of points in n dimensions, as facets of point indices. |
criticalAlpha | Smallest alpha at which an alpha shape meets a connectivity criterion. |
inShape | Tests whether points lie inside an alpha shape. |
numRegions | Number of disjoint regions of an alpha shape. |
perimeter | Perimeter length of a polyshape or a 2-D alpha shape. |
surfaceArea | Surface area of a 3-D alpha shape. |
volume | Volume enclosed by a 3-D alpha shape. |
Triangulation Representation
barycentricToCartesian | Converts barycentric coordinates in given triangles or tetrahedra to Cartesian coordinates. |
baryToCart | Legacy form of barycentricToCartesian for TriRep and DelaunayTri objects. |
boundaryshape | Converts the boundary of a 2-D triangulation into a polyshape. |
cartesianToBarycentric | Converts Cartesian points to barycentric coordinates relative to given triangles or tetrahedra. |
cartToBary | Legacy form of cartesianToBarycentric for TriRep and DelaunayTri objects. |
circumcenter | Circumcenters (and circumradii) of the triangles or tetrahedra in a triangulation. |
circumcenters | Legacy form of circumcenter for TriRep and DelaunayTri objects. |
edgeAttachments | Triangles or tetrahedra attached to given edges of a triangulation. |
edges | All edges of a triangulation, as pairs of vertex indices. |
faceNormal | Unit normal vector of each triangle of a triangulated surface. |
faceNormals | Legacy form of faceNormal for TriRep and DelaunayTri objects. |
featureEdges | Sharp edges of a triangulated surface, selected by the angle between adjacent faces. |
freeBoundary | Boundary facets of a triangulation: edges of a 2-D mesh or faces of a 3-D one that touch only one simplex. |
incenter | Incenters and inscribed-circle radii of the triangles or tetrahedra of a triangulation. |
incenters | Legacy form of incenter for TriRep and DelaunayTri objects. |
isConnected | Tests whether pairs of vertices are joined by an edge in a triangulation. |
isEdge | Tests whether pairs of vertices form an edge of a legacy DelaunayTri or TriRep triangulation. |
nearestNeighbor | Nearest vertex of a triangulation or alpha shape to each query point. |
pointLocation | Finds the triangle or tetrahedron of a triangulation that contains each query point. |
stlread | Reads a triangulated surface from an STL file. |
stlwrite | Writes a triangulation to an STL file. |
tetramesh | Draws a tetrahedral mesh as semi-transparent solid elements. |
triangulation | Stores a 2-D or 3-D triangulation and answers queries about it. |
trimesh | Plots a triangular mesh as wireframe edges. |
triplot | Plots a 2-D triangulation as line edges. |
TriRep | Legacy triangulation representation class, replaced by triangulation. |
trisurf | Plots a triangular surface with shaded faces. |
vertexAttachments | Lists the triangles or tetrahedra attached to given vertices. |
vertexNormal | Unit normal vector at the vertices of a triangulated surface. |
Delaunay Triangulation
convexHull | Convex hull of the points of a Delaunay triangulation, as point indices. |
delaunay | Delaunay triangulation of 2-D or 3-D points, as a matrix of triangle or tetrahedron indices. |
delaunayn | Delaunay triangulation of points in n dimensions. |
DelaunayTri | Legacy class that builds and stores the Delaunay triangulation of a point set. |
delaunayTriangulation | Creates a Delaunay triangulation object from 2-D or 3-D points. |
inOutStatus | Flags which triangles of a constrained Delaunay triangulation lie inside the constrained region. |
isInterior | Flags the triangles of a constrained Delaunay triangulation that lie inside the constrained region. |
voronoiDiagram | Returns vertices and cells of the Voronoi diagram of a delaunayTriangulation. |
Spatial Search
dsearchn | Index of the nearest point in a set, for each query point. |
tsearchn | Finds the enclosing simplex of query points in an n-D triangulation. |