SOLUTION: How to draw 7 identical circles, with 6 touching the central circle. Circle=polygon of large no side, say 360. Kindly send me the code in C++.

Algebra ->  Circles -> SOLUTION: How to draw 7 identical circles, with 6 touching the central circle. Circle=polygon of large no side, say 360. Kindly send me the code in C++.      Log On


   



Question 1151686: How to draw 7 identical circles, with 6 touching the central circle. Circle=polygon of large no side, say 360.
Kindly send me the code in C++.

Answer by Edwin McCravy(20060) About Me  (Show Source):
You can put this solution on YOUR website!
To draw this "Vienna sausage" arrangement:

 

You just need the coordinates of the centers and the radius. If you use 1 for
the radius and coordinate axes, you get this:

 

As you see, the centers form a regular hexagon, which is made up of 6
equilateral triangles, and each equilateral triangle is made up of 2
30°-60°-90° right triangles.  So there are 12 30°-60°-90° right triangles.

I used the radius of the circles as 1, but you can make it anything you like.

The shortest side of a 30°-60°-90° triangle is 1 times the length of the radius.
The medium side is sqrt(3) times the length of the radius,
The longest side (the hypotenuse) is 2 times the length of the radius.

That's all you need to write up the C++ coding.

Edwin