Given that n disks/circles share a common area, meaning that every two of them intersect one another, and we know their coordinates (x1,y1,r1), (x2,y2,r2), ..., (xn,yn,rn), where xi,yi,rn represent the x axis coordinate, the y axis coordinate, and the radius of the ith disks/circle, respectively, can you provide a method to calculate the coordinate of the centroid of the intersection of these disks/circles?!
相关问题
- Finding k smallest elements in a min heap - worst-
- binary search tree path list
- High cost encryption but less cost decryption
- How to get a fixed number of evenly spaced points
- How to determine +/- sign when calculating diagona
相关文章
- What are the problems associated to Best First Sea
- Coin change DP solution to keep track of coins
- Algorithm for partially filling a polygonal mesh
- Robust polygon normal calculation
- Algorithm for maximizing coverage of rectangular a
- How to measure complexity of a string?
- Select unique/deduplication in SSE/AVX
- How to smooth the blocks of a 3D voxel world?
Let's assume that all the circles overlap such that one can trace a path from any point in one of the circles to an arbitrary point in any other circle while traversing only points contained by circles. And, for generality, that the circles may be of different radii.
Per the wiki page you can decompose this shape into separate geometric regions. That is, you can find an intermediate value for the centroid by considering each circle separately (i.e. pretending they do not overlap).
Unfortunately some of the circles overlap, so you will be counting regions of the figure twice. The figure below, taken from this page, shows these regions of overlap. You therefore must find the centroid of the circle-circle intersection and subtract this from your intermediate centroid (see the wiki page's description of geometric decomposition for further details).
Since you can determine which circles overlap just do these for each overlapping pair and then each region of space will be counted only once. Your problem then reduces to finding the centroid of a circle-circle intersection.
You can find this by using geometric decomposition to break each lens of intersection into circular segments with the height of the segment given via a method here and coupling the result with appropriate coordinate transformations to rotate and translate the centroid to a location relative the center of one of the circles.