How to design an algorithm to find minimum no.of sides of a polygon which lies between two concentric circles?
Similar to this:

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Think about the simplest case first: the inner circle is microscopically small. The minimum number of sides is 3, as long as the inner circle has a non-zero radius.
When does the polygon start needing 4 sides? Draw an equilateral triangle inscribed in the circle. The polygon starts needing 4 sides when the inner circle’s radius reaches the center point of the sides of the triangle.
If you inscribe a regular polygon of N sides into the outer circle, you can compute the distance from the midpoint of each side to the center of the circle using the cosine rule:
(Explanation: if you make a isosceles triangle using the center point of the circle to the side in question, the radii have an angle of 360 / N. Divide the triangle in half at the side’s midpoint to form a right-angle triangle with hypotenuse equal to the radius of the outer circle, then use cosine rule)
Now
distance_to_midpointneeds to be greater than or equal to the radius of the inner circle, so solve forN:(I haven’t double checked this math, and it’s really late).