Circle inscribed in a rectangle

时间:2015-12-03 10:37:02

标签: algorithm math graphics

I am given a lot of points and the points are suppose to be from a rectangle. I'm required to calculate the boundary of the rectangle.(which is relatively easy) But I also have to figure out radius of a candle(cylinder) that could be anywhere in the rectangle. All of this from just the given points. I would appreciate if someone could suggest ways to achieve this.

The points in my case are measurements of a robot wandering through this rectangle, and the empty circle is a pole of a certain unknown radius inside the rectangle that the robot can hit. So I need to figure out the radius of the pole in order to avoid that. I need to estimate the pole. It doesn't have to be exact. I'm expecting robot measurements to be enough that they'd give me pretty good idea where pole is.

1 个答案:

答案 0 :(得分:0)

如果你能负担得起,只需光栅化该区域,标记受影响的像素,然后开始"成长"它们周围的区域直到它们相遇(这将为您提供其Voronoi区域的光栅版本)。距离任意点距离最远的像素(矩形内部)可能是空心圆的中心。

或者,您可以进行Delauney三角剖分,找到矩形内的最大三角形,并在它们形成凸形时添加它们的邻居。那个形状将是圆的近似值。