dividing the irregular polygon

  area, c++, polygon

I have an irregular polygon that needs to be divided by an intersecting line(dynamic).
I have calculated the area of a polygon using shoe lac formulae
but I am not able to understand how to get the area when it is divided by an intersection line (the line will be drawn dynamically on the irregular polygon)
I want to get the vertices so that I can calculate the area of both part A & B as in the attached image

Example of

Any suggestionapproach is appreciated

Source: Windows Questions C++