polygon operation union, subtract

Good Afternoon

We need your help
Could you please tell us how this is possible to add the polygons to each other, and how to disjoin them from one another when we have their coordinates?

For example, the massive of the first, second, and third polygons
1. [-97.0, 31.0, -97.0, 39.0, -87.0, 39.0, -87.0, 31.0]
2. [ -95.0, 33.0, -89.0, 33.0,-89.0, 37.0,-95.0, 37.0]
3. [-93.0, 34.0,-91.0, 34.0,-91.0, 36.0,-93.0, 36.0]

We need to create a polygon out of the coordinates, the first polygon is to be added to the second one. From what we get, we need to separate the third polygon. Which means, after doing the first two operations we need to get the third polygon.

We found such operations earlier, but only for squares Cesium.BoundingRectangle.union(left, right, result)

Unfortunately these operations cannot help us, because the polygons are not squares.
Could you please tell us if there are some other functions that can help us, or the way how we can solve the issue?

Hi,
turf.js may help you : http://turfjs.org/docs/#union

Br

Fred.

Thank you for your answer
We tried out this library, unfortunately it doesn't allow us to perform all the necessary functions
It helps us only to add polygons, but not to separate them

Can you please recommend us any other libarary that could be helpful for us?

have a look at this javaScript topology library,

https://github.com/bjornharrtell/jsts