0

I am creating a graph interface with different nodes and a selected node at the center. I created the center node and I drew a circle to mark the location around which the subnodes will be placed.

I wanted to place many nodes in the circumference of the circle without each overlapping other. How do I find exactly how many can be placed in circumference?

Each of my subnode views will have the same size. But irrespective of that, the arcLength occupied by each of the sub nodes in circumference of circle is different .

How do I find the total no of controls with a certain size that are possible to be placed in a circle's circumference with a particular radius . And how do I find the center point of each subnodes to be placed in circle's circumference.

I know that we can use the below formulas to find the angle to traverse to place the subnodes. The problem here is the arcLength is not fixed for each subnode view.

2PirC/360 = arcLength x = cx + r * cos(a) y = cy + r * sin(a)

enter image description here enter image description here

Hasintha Janka
  • 1,608
  • 1
  • 14
  • 27
RK-
  • 12,099
  • 23
  • 89
  • 155
  • Have you investigated [algorithm to detect if a Circles intersect with any other circle in the same plane][1]? [1]: http://stackoverflow.com/questions/8367512/algorithm-to-detect-if-a-circles-intersect-with-any-other-circle-in-the-same-pla – verec Apr 07 '13 at 03:57
  • I'm a bit confused with what you meant about arc length. If each view on the circumference of the circle is the same size, then they will occupy the same arc length. – Anthony Tyler Apr 11 '13 at 15:00

1 Answers1

0

I have solved the problem by using the below formula which was mentioned in the answer in this thread in Stackoverflow:

(x + r cos(2kπ/n), y + r sin(2kπ/n))

Community
  • 1
  • 1
RK-
  • 12,099
  • 23
  • 89
  • 155