使用不同范数绘制 Voronoi 图

发布于 2024-12-12 14:41:57 字数 471 浏览 3 评论 0原文

我在使用 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_无穷范数的图表......

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼波传意 2024-12-19 14:41:57

来自 Mma 帮助(仅近似值):

在此处输入图像描述

在此处输入图像描述

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

在此处输入图像描述

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文