You will write three functions that find areas of polar regions by adding thin sectors. The checker uses a cardioid, a rose and the region between a circle and a cardioid.
The idea. A thin sector of angle and radius has area . Take the radius at the middle of each small step in .
Your tasks.
sector_area(r, a, b, n). The function r takes an angle. Split into n equal steps and add at the middle of each step.between_area(outer, inner, a, b, n). Return the area between the curves for .rose_area(a, n). Return the area of the whole rose , using sector_area. A rose with an odd n is complete for . A rose with an even n needs .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…