Find polygon from lines and area

Hi, I need to find the exactly polygon of a terrain.
For it, I have the measure of each line of this and the total area, but not the angle between them.
For example, I have 4 lines, but not the angle between then and I need to know the exactly polygon.

Can someone help?

There might be an easier way, but this is a VERY large design space so my mind went straight to Refinery.

Building a parametric model of the first two edges, and using the remaining lengths to find the two possible edges which could close the loop with the given distances is doable with out of the box Dynamo.

Finding the optimal first angle (every other angle will be dictated by that) is a bit more difficult with a lot of trial and error as a result. Fortunately Refinery can do this optimization for us quite readily.


Thanks! Can you send the code block here?