Solving roots and calculating area of polygon