假设您有一个顶点为A
,B
和C
的任意三角形。 This paper (section 4.2)说你可以从三角形ABC
内由顶点的下面凸组合生成一个随机点,P
,均匀地:三角形中的样本随机点
P = (1 - sqrt(r1)) * A + (sqrt(r1) * (1 - r2)) * B + (sqrt(r1) * r2) * C
其中r1
和r2
均匀地从[0, 1]
绘制的,sqrt
是平方根函数。
你如何证明均匀分布在三角形内的采样点ABC
?
编辑
正如评论指出了the mathoverflow question, Graphical Gems discusses this algorithm。
这可能更适合http://math.stackexchange.com/ – 2011-01-24 02:54:19
http://math.stackexchange.com/questions/18686/uniform-random-point-in-triangle – dsg 2011-01-24 04:02:17