Say I have two lists with x and y points like this.

```
Dataset 1
[[1.0,2.0],
 [2.0,2.4],
 [3.0,2.8],
 [4.0,3.5],
 [5.0,4.0]]

Dataset 2
[[2.4,1.0],
 [2.8,1.0],
 [3.1,1.0],
 [4.0,1.0]]

```

I want to add them together so the result looks like this

```
[[1.0,2.0],
 [2.0,2.4],
 [2.4,2.6],
 [2.4,3.6],
 [2.8,3.7],
 [3.0,3.8],
 [3.1,3.9],
 [4.0,4.5],
 [4.0,3.5],
 [5.0,4.0]]

```

So by combining the red and blue graph below the result should be the grey line.
Are there any known algorithms that can be used to accomplish this?

![enter image description here](https://i.stack.imgur.com/Uy3kK.png)