# Find fractional area of a circle

Given a circle of radius $$r$$ and area $$A$$, I would like to compute $$h$$ that is the height of the colored area. That area has area $$F$$ which is a percentage of the total area of the circle.

To do so, I found that method that uses Netwon's approximations:

iterations = 10

t_1 = (12 F PI)^(1/3)

for(i = 0; i < iterations; i++) {
t_0 = t_1
t_1 = sin(t_0) - t_0 cos(t_0) + ((2 F PI) / (1 - cos(t_0)))
}

F = (1 - cos(t_1 / 2)) / 2
h = 2 r F
y = r - h



This method seems to work but what does t_1 = (12 F PI)^(1/3) represents?

• You're trying to find the Area of a Segment. Do you understand the method used to do so? If so, you should also be able to understand what the code is doing. Commented Jul 13, 2020 at 13:16
• That is just a safe initial starting point for Newton's method. It does not represent anything in particular. What makes something a safe starting point depends on what function you are approximating. Commented Jul 13, 2020 at 13:54
• @AniruddhaDeb Thanks for your reply. No, I didn't understand what the method does. I need help Commented Jul 13, 2020 at 13:55
• @JaapScherphuis Thanks for your answer. Can you explain it better? It's not so clear to me. Also in the for loop, what is (2 F PI)? Commented Jul 13, 2020 at 15:07

Let $$t$$ be the angle subtending the coloured segment. Then the area of the segment is $$(t-\sin{t})\frac{r^2}{2}$$.

You want the area to be equal to $$F\cdot \pi r^2$$.

The $$r^2$$ cancels, leading to the equation:

$$t - \sin t - F\cdot 2\pi = 0$$

If you let $$f(t)=t - \sin t - F\cdot 2\pi$$, then $$f'(t) = 1 - \cos t$$. Applying Newton's method to this function $$f(t)$$ gives you the iterative step:

$$t_{n+1} = t_n - \frac{f(t_n)}{f'(t_n)}$$ $$= t_n - \frac{t_n - \sin t_n - F\cdot 2\pi}{1 - \cos t_n}$$ $$= \frac{\sin t_n - t_n \cos t_n + F\cdot 2\pi }{ 1 - \cos t_n}$$

Note that the brackets in the OP are incorrect.

Once you've found a good approximation of $$t$$ (e.g. $$t_{10}$$), you can calculate the distance from $$O$$ to the segment as $$y=r\cos \frac{t}{2}$$, and then the height of the segment as $$h=r-y$$.

• Thanks a lot! Very good explaination! Commented Jul 13, 2020 at 19:49