开发者

Voronoi plot, line crossing

I have the following problem. Initially I create 10 points, in a 2-D space, randomly distributed and then I use the Voronoi function to creat polygons. But I want my Voronoi polyhedra to obey a gaussian-normal distribution. So the area of each 开发者_如何学Cpolygon should obey this rule. But I cannot do this since my polyhedra are not convex but have vertices and corners outside the plot, extending to infinity. So what I want to do is to assign the crossing of the lines of the corresponding polygons with the borders of the plot. but how can I get the line intersections? I know the point inside the plot , but I donnot know anything about the point outside the plot.. Thank you very much for your help!

Panos


You may better specify the terms of your problem

  1. Why your vertices got to infinity? Are random points choosen all over 2d plan or inside a specified area?
  2. Why you don't know nothing about other points?


You should probably calculate the intersections automatically. You would first need to detect the two lines which you would need to calculate. from there, you need will need two points on each line. (x1a, y1a), (x2a, y2a) and (x1b, y1b), (x2b, y2b)

from here, use the point-slope equation to find where these lines intersect:

if y-y1a=m(x-x1a) and m=(y2a-y1a)/(x2a-x1a)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜