geometry - Algorithm for bisecting a set of points using a circle of fixed radius -
suppose have set of points in cartesian plane, defined array/vector of (x,y) coordinates. set of points "contiguous" in coordinate plane, if set of discontinuous points can contiguous. is, these points originated rectangular grid in regions of points eliminated prior algorithm. shape outlined points arbitrary, tend have arcs edges.
suppose further can create circles of fixed radius r
.
i algorithm find me center x,y
circle enclose close half of given points possible.
ok, try (sorry if have bad wording: didn't learn maths in english)
step 1: find axis
- for pairs of points, that less 2r apart calculate how many points lie on either side of connecting line
- chose pair worst balance
- calculate line, bisects these 2 points axis ("axis of biggest concavity")
step 2: find center
- start on axis far (>2r) away on side, had lower point count in step 1 (the concave side)
- move center on axis, until reach desired point. can done moving step of sqrt(delta), delta smallest distance between 2 points in set, if overreaching move halfing step, etc.
Comments
Post a Comment