2013-07-22 225 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:如果它給出你正在尋找的東西,你應該「接受」答案。 (點擊選票左側的空白複選標記) –