0
$\begingroup$

I want to write a program in C++ to calculate the area of irregular cyclic convex polygons. However, the inputs are in the form corner point angles. I am just not sure what the inputs mean and what formula to use. Here is the question; I just need an explanation of what the input means and what equation to use to calculate the area.

The question paper

$\endgroup$
  • $\begingroup$ @NormalHuman yah but i am not familiar with the subject area do you know what it should be? $\endgroup$ – Fahad Albalawi Oct 24 '15 at 4:32
0
$\begingroup$

Let the radius be $r$.

Inputs are $a_i$; where $i = 1, …, n$. Of course, all input should observe the rule $0^0 \le a_i \le 360^0$.

A simple sorting and re-ordering is necessary to ensure that $a_i \lt a_j$ if $i \lt j$.

Thus, after the above, we can assume that all these con-cyclic points are in anti-clockwise order.

For an $a_i$, there is a corresponding con-cyclic point whose co-ordinates are $(r \cdot \cos (a_i), r \cdot \sin (a_i))$.

The required area can then be obtained using the shoelace theorem. Example link = http://www.avmathteam.org/lessons/shoelacetheorem

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.