用不同的规范绘制VoronoiDiagram

时间:2011-10-29 17:36:34

标签: graph wolfram-mathematica voronoi

我使用mathematica(使用版本8)遇到了很大的问题。 绘制Voronoi图是很简单的事情,但如何改变规范呢?

<< DiscreteMath`ComputationalGeometry`
data2D = {{4.4, 14}, {6.7, 15.25}, {6.9, 12.8}, {2.1, 11.1}, {9.5, 
14.9}, {13.2, 11.9}, {10.3, 12.3}, {6.8, 9.5}, {3.3, 7.7}, {0.6, 
5.1}, {5.3, 2.4}, {8.45, 4.7}, {11.5, 9.6}, {13.8, 7.3}, {12.9, 
3.1}, {11, 1.1}};
DiagramPlot[data2D, LabelPoints -> False]

给出了与L_2范数(欧几里德范数)相对应的Voronoi图。 我需要L_1范数和L_infinity范数的图...

1 个答案:

答案 0 :(得分:7)

来自Mma help(仅近似值):

enter image description here

enter image description here

ColorCombine[{Image[ WatershedComponents[
    DistanceTransform[i, DistanceFunction -> ManhattanDistance]], 
    "Bit"], i, i}]

enter image description here

注意:请注意,Voronoi多边形的凸性属性会丢失......