You could have done it a lot simpler.

A circle can be roughly represented as lots of triangles (with the same area) put together. Like a pizza, yes.

Let's look at one of these triangles (they are all equal). The angle that touches the center of the circle can be obtained easily : for example, if you use triangles, then each triangle will have that angle equal to , because .

Now, you know two sides of the triangle easily, too, because they are equal to the radius of the circle (let's take ).

So, if we take a triangle ABC, with A pointing towards the center of the circle, we have : angle , where is the number of triangles wanted, and (radius of the circle).

Now, what was the goal of this, already ? Ah, yes, approximating the area of the circle. Thus, we need to know the area of the triangles. Note that since triangle ABC is isosceles, we can divide it into two equal rectangle triangles. Let be the middle of .

Therefore, angle , and using trigonometry, , thus .

You are still missing something ! You need the side to calculate the area. Since you know two sides in the rectangle triangle, you can use trig :

, thus .

From there you can calculate the area of the rectangle triangle. Let be the area of the rectangle triangle.

.

Now remember we divided our isosceles triangle into two equal rectangle triangles, therefore the area of the isosceles triangle must be twice the area of the rectangle triangle. Let be the area of the isosceles triangle.

.

Now that you know that, all you have to do is multiply this area by the quantity of triangles used. Let be the area of the circle.

.

That is :

.

Note that this only works if (can you put two triangles next to each other inside a circle ? and also, and fails).

(Remember that the area of a circle of radius is equal to ). Let's see how our formula goes :

, . That is not awesome yet ...

, . Now this is great !

Provided you input enough triangles (a greater ), and that your computing device has good floating point precision, you can approximate your areas easily !

PS : this formula only works with a circle of radius . I think you can change it easily enough yourself to make it fit to any circle, by introducing a new parameter (radius). Okay, I'll give you a hint : it only involves multiplying the area of a -radius circle by