Question

I got a big prob with mathematica(using version 8). Plotting a Voronoi Diagram is simple stuff, but how about changing the norm?

<< 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]

Gives me the Voronoi Diagram respective to the L_2-norm(euclidean norm). I am needing the Diagram respective to the L_1-norm and the L_infinity-norm as well...

Was it helpful?

Solution

From Mma help (only an approximation):

enter image description here

enter image description here

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

enter image description here

NB: Please note that the convexity property for the Voronoi polygon is lost ...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top