Archimedes found by drawing polygons inside a circle and doubling the number of sides again and again. A regular polygon with sides inside a circle of radius has half-perimeter , which comes closer and closer to . He had no calculator, but he had the half-angle formulae, and so do you.
The idea. From , the half angle gives and . The second is the for twice as many sides. You start from a square, where .
Your tasks.
half_cos(c) return , the cosine of half the angle.s to from c, with the half-angle formula.sides_needed to the first n in ns whose estimate is within of .Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…
With Standard, you also open 4 more problems and 1 Python lab. Everything you have used here stays free, always.