问题描述
我想计算的平均值和二维(如果区域延伸到无穷远,我只是把它夹到单位正方形)。
I would like to compute the mean and standard deviation of the areas of a set of Voronoi regions in 2D (if the region extends to infinity, I'll just clip it to the unit square).
不过,如果可能,我愿意做这个计算从Delaunay三角没有明确计算Voronoi区?这甚至可能,或者是它最好只计算Voronoi图明确?
However if possible I would like to do this computation from the Delaunay Triangulation without explicitly computing the Voronoi regions? Is this even possible, or is it better to just compute the Voronoi diagram explicitly?
推荐答案
为了计算出你需要遍历它周围的1环顶点的Voronoi图区域。然后该区域的面积被定义为:
In order to calculate the voronoi region of a vertex you need to iterate the 1-ring around it. Then the area of the region is defined as:
A = 1/8 * (sum for every adjacent vertex p_i) { (cot alpha_i + cot beta_i) * (p_i - c).Length² }
在图像,你可以看到淡红色,整个的Voronoi区域。它的一部分显示在暗红色。这是通过相加蓄积的部分之一。 字母
和测试版
是角度的图像中可见。 C
为中心的顶点位置。 p_i
则相反vertex_position。 字母
,测试版
和 p_i
变化,而迭代。 C
保持它的价值。
In the image you can see the whole voronoi region in light red. A part of it is shown in dark red. This is one of the parts accumulated by the sum. alpha
and beta
are the angles as visible in the image. c
is the center vertex position. p_i
is the opposite vertex_position. alpha
, beta
and p_i
change while iterating. c
keeps its value.
如果您计算这些部分的每一个相邻的顶点,你得到的Voronoi区的8倍的面积。
If you calculate those parts for every adjacent vertex, you get 8 times the area of the voronoi region.
这篇关于计算Voronoi区从Delaunay三角的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!