2013-07-22 131 views

回答

4

作为评价提到贝利萨留,存在一种用于在数学三角测量的命令。它被称为PlanarGraphPlot。这是如何工作的:

Needs["ComputationalGeometry`"] 
g = Table[RandomReal[{0, 100}, 2], {i, 1, 100}]; 
ListPlot[g, AspectRatio -> 1] 

A random graph

PlanarGraphPlot[g, LabelPoints -> False] 

triangulated graph

或许,使用Show你可以绘制他们在彼此的顶部:

Show[PlanarGraphPlot[g, LabelPoints -> False], ListPlot[g, AspectRatio -> 1, PlotStyle -> {Large, Red}]] 

enter image description here

+0

太棒了!谢谢Ali和belisarius。有没有一种方法可以从这个图中获得AdjacencyMatrix。我注意到,DelaunayTriangulation []给出的列表格式与AdjacencyList格式不同,绝对不是AdjacencyMatrix格式。我最终需要1个矩阵,其所有坐标{{x1,y1},{x2,y2},...}和1个矩阵的边/链接{{0,0,1,1,0},{ 0,1,0,0},...},即AdjacencyMatrix。有关如何从DelaunayTriangulation []到AdjancencyMatrix的想法? – LBogaardt

+1

@LauBo:如果它给出你正在寻找的东西,你应该“接受”答案。 (点击选票左侧的空白复选标记) –