non intersecting circles

sam

Member
Joined
Sep 8, 2016
Messages
10
Programming Experience
Beginner
HI,

I have one circle with radius & center point, I have to place multiple circles with radius known but center point unknown (needs to be calculated based on 1st circle-non intersecting). I can move circle in x direction till it is not intersecting with 1st circle. Similarly 3rd circle, 4th circle. NOw 5th circle needs to moved in y direction till it is non intersecting, (7th,8th,9th in increasing value of x & y value same as that of 5th. Please if anyone has some code , can please share ?

Thanks
 
As for all problems, work out the logic first and then write the code to implement that logic that you already understand. Pick up a pen and paper and draw the circles one by one and apply your mind to the logic involved in what you're doing, then codify that logic.
 
With the 5th, 6th, 7th, 8th, and 9th circles be guaranteed to have radii smaller than any of the 1st, 2nd, 3rd, and 4th circles?
Will the 5th circle have a radius that is greater than the 6th, 7th, 8th, and 9th?
How many circles will you have in all? Will there always only 4 circles on the first row, and all the other circles will be on the second row?
 
Back
Top Bottom