Any polygon can be decomposed into $(n-2)$ triangles where $n$ is the number of vertices. The simplest way to do this is to choose a vertex and join it to each of the other vertices that are not adjacent to it. The following diagram illustrates that process for a pentagon and a hexagon:
In the above cases the area of the whole polygon is the result of adding together the triangles of which they are composed. Unfortunately this is not always the case, as you will see if you use the following shape and the point indicated: For the purposes of this exercise you can assume that you do not have such a case.
Write a function that calculates the area of a polygon by summing the areas of the triangles that are obtained by joining the first vertex of a shape object to each of the others.
I am not providing a model answer to this one because I do not want to place temptation in your way. It you cannot manage it now, come back to it later.