Merge smoothly two discontinuous segments over a given gap

31 Views Asked by At

I am facing a problem where I don't find a good solution, so here I am.
My problem is: Given three intervals where two segments are defined in the first and the last interval respectively, find a smooth function in the second interval joining them.

For example let's assume the first segment defined by points $P_0=(x_0, y_0$) and $P_1=(x_1, y_1$) and the second one by $P_2=(x_2, y_2$) and $P_3=(x_3, y_3$), with $x_0<x_1<x_2<x_3$. How can we find a function that links $P_1$ and $P_2$ smoothly?

I have tried by looking at a circle tangent to the two segments and passing through points $P_1$ and $P_2$ without success. Can anybody help me?

Thanks in advance for your help and time!

Edit: Here is an example of what I am trying to achieve: find an equation of a function that merge smoothly two segments (for example with a circle)