1 # Created by Octave 3.6.2, Sun Jun 10 09:53:43 2012 UTC <root@brouzouf>
13 # name: <cell-element>
17 -- Function File: [POINTS EDGES]= delaunayGraph (POINTS)
18 Graph associated to Delaunay triangulation of input points
20 Compute the Delaunay triangulation of the set of input points, and
21 convert to a set of edges. The output NODES is the same as the
26 % Draw a planar graph correpspionding to Delaunay triangulation
27 points = rand(30, 2) * 100;
28 [nodes edges] = delaunayGraph(points);
30 drawGraph(nodes, edges);
32 % Draw a 3Dgraph corresponding to Delaunay tetrahedrisation
33 points = rand(20, 3) * 100;
34 [nodes edges] = delaunayGraph(points);
36 drawGraph(nodes, edges);
39 See also: delaunay, delaunayn
45 # name: <cell-element>
49 Graph associated to Delaunay triangulation of input points
54 # name: <cell-element>
61 # name: <cell-element>
65 -- Function File: drawGraph (NODES, EDGES)
66 -- Function File: drawGraph (NODES, EDGES, FACES)
67 -- Function File: drawGraph (GRAPH)
68 -- Function File: drawGraph (..., SNODES)
69 -- Function File: drawGraph (..., SNODES, SEDGES)
70 -- Function File: drawGraph (..., SNODES, SEDGES, SFACES)
71 -- Function File: H = drawGraph (...)
72 -- Function File: [H HE] = drawGraph (...)
73 -- Function File: [H HE HF] = drawGraph (...)
74 Draw a graph, given as a set of vertices and edges
76 DRAWGRAPH(NODES, EDGES) draw a graph specified by a set of nodes
77 (array N*2 or N*3, corresponding to coordinate of each node),
78 and a set of edges (an array Ne*2, containing for each edge the
79 first and the second node). Default drawing is a red circle for
80 nodes and a blue line for edges.
82 DRAWGRAPH(NODES, EDGES, FACES) also draw faces of the graph as
85 DRAWGRAPH(GRAPH) passes argument in a srtucture with at least 2
86 fields named 'nodes' and 'edges', and possibly one field
87 'faces', corresponding to previously described parameters.
88 GRAPH can also be a cell array, whose first element is node array,
89 second element is edges array, and third element, if present, is
92 DRAWGRAPH(..., SNODES) DRAWGRAPH(..., SNODES, SEDGES)
93 DRAWGRAPH(..., SNODES, SEDGES, SFACES) specify the draw mode for
94 each element, as in the classical 'plot' function. To not
95 display some elements, uses 'none'.
97 H = DRAWGRAPH(...) return handle to the set of edges.
99 [HN, HE] = DRAWGRAPH(...) return handle to the set of nodes and
102 [HN, HE, HF] = DRAWGRAPH(...) Also return handle to the set of
109 # name: <cell-element>
113 Draw a graph, given as a set of vertices and edges
118 # name: <cell-element>
125 # name: <cell-element>
129 -- Function File: EDGES = knnGrpah (NODES)
130 Create the k-nearest neighbors graph of a set of points
132 EDGES = knnGraph(NODES)
137 edges = knnGraph(nodes);
138 drawGraph(nodes, edges);
144 # name: <cell-element>
148 Create the k-nearest neighbors graph of a set of points
153 # name: <cell-element>
160 # name: <cell-element>
164 -- Function File: [NODES EDGES FACES] = voronoi2d (GERMS)
165 Compute a voronoi diagram as a graph structure
167 [NODES EDGES FACES] = voronoi2d(GERMS) GERMS an array of points
168 with dimension 2 NODES, EDGES, FACES: usual graph representation,
173 [n e f] = voronoi2d(rand(100, 2)*100);
180 # name: <cell-element>
184 Compute a voronoi diagram as a graph structure