Minimizing the maximum curvature: a real-life, liquid-filled pipe question I've searched Stack Exchange for this question, but have only found Bezier curves which I don't think is what I'm looking for.
I have a real-world problem where I need to design a system of water-carrying pipes and want to minimize the maximum curvature so as to minimize the likelihood of kinking the pipes. 
The problem is the described below. As shown in the picture, I have pipe-1 (red) that reaches point $(x_1,y_1)$ with slope $m_1$ and I need to connect it to pipe-2 (blue) at $(x_2,y_2)$ where the pipe it is connecting to there has a slope $m_2$. The pipe (green curve) that I am trying to fit between these two points has to come in tangent to pipe-1 and pipe-2 at each end.  Any chance someone could help me determine the equation for the curve between these two pipes that would minimize the maximum curvature and reduce the chance my pipes are kinked?
Many thanks!

 A: This path respects your constraints, is it acceptable?

A: 
I don’t think that there exists a single curve with minimum possible curvature, which can join the end points of two separate sections of a path (in your case it is a pipeline under construction), when the slopes at those two points are known. In general, the solutions to this kind of problems come in the form of piecewise curves (i.e. splines). However, it may be possible to find a conic or conics (e.g. ellipse or circle), which starts tangentially to one section at its end point and touches a straight line, which is tangential to the other section at its end point. Such solutions do not always guarantee to minimize the curvature.
We give a simple construction to find a solution, which uses method described in the previous chapter. We extend both $AB$ and $CD$, so that they meet at $E$. Then, we draw the angle bisector of $\angle DEF$. Next, we construct the perpendicular to $CD$ through $D$ to intersect the angle bisector. There meeting point $O$ is the center of the sought circle. We also drop a perpendicular from $O$ to $AB$ and denote its foot as $F$. We have $OD=OE$.  Therefore, to complete the construction, we can draw the arc $DF$ taking $O$ as its centre. We can calculate the radius $r$ of the arc and the length of the required piping as shown below.
If we assume the $y$-intercepts of the lines $AB$ and $CD$ as $c_1$ and $c_2$, we can write down the their equations as,
$$AB:\enspace y=m_1x+c_1=0\qquad\text{and}\qquad CD:\enspace y=m_2x+c_2=0,\tag{1}$$
$$\text{where}\quad c_1= y_1-m_1x_1\qquad\text{and}\qquad c_2= y_2-m_2x_2.\qquad\qquad\enspace$$
Using (1) we can find the $x$- and $y$-coordinates of $E$.
$$x_E=\dfrac{c_1-c_2}{m_2-m_1}\qquad\qquad y_E=\dfrac{c_1 m_2-c_2 m_1}{m_2-m_1}\tag{2}$$
The equation of the angle bisector of $\angle DEF$ can be derived from(1).
$$\dfrac{y-m_1x-c_1}{\sqrt{1+m_1^2}}=\dfrac{ y-m_2x-c_2}{\sqrt{1+m_2^2}},\tag{3}$$
which, for brevity, we state as $y=m_3x+c_3$.
The perpendicular to $CD$ through $D$ is,
$$y=-\dfrac{x}{m_2}+y_2+\dfrac{x_2}{m_2},\tag{4}$$
which we write as $y=m_4x+c_4$.
The coordinates of $O$ can be determined using (3) and (4).
$$x_O=\dfrac{c_3-c_4}{m_4-m_3}\qquad\qquad y_O=\dfrac{c_3 m_4-c_4 m_3}{m_4-m_3}\tag{5}$$
Using (5), radius $r$ of the circular arc $DF$ can be expressed in terms of the coordinates of $D$ and $O$ as,
$$r=OD=\sqrt{\left(x_2-x_O\right)^2+\left(y_2-y_O\right)^2}\tag{6}$$
Similarly, the distance $ED$ can be calculated from (2).
$$ DE=\sqrt{\left(x_2-x_E\right)^2+\left(y_2-y_E\right)^2}\tag{7}$$
Use (6) and (7) to express $\theta$.
$$\theta = \tan^{-1}\left(\dfrac{r}{DE}\right)\tag{8}$$
Therefore, the length of arc $DF$ is given by $DF=2r\theta$.
To find the length $BF$, we need to calculate the length of $OB$ as shown below.
$$OB^2=\left(x_1-x_O\right)^2+\left(y_1-y_O\right)^2$$
$$BF=\sqrt{OB^2-r^2}$$
$\bf{\underline{Note\space 1}}\enspace$ Our two-piece curve, which includes a circle and a straight line, is shown superimposed over your sketch for the sake of comparison with the curve you have drawn. Your curve looks like a part of a parabola. If so, it can be shown that this parabola has the curvature $\kappa_p$ near point $D$.
$$\kappa_p=\dfrac{2\big|y_1-y_2\big|}{\left(x_1-x_2\right)^2}$$
If $\kappa_p\gt\dfrac{1}{r}$, we can conclude that “circle+line” solution is better than “parabolic” solution as far as kinking is concerned. However, if the parabolic solution is used, the required length of piping is shorter.
$\bf{\underline{Note\space 2}}\enspace$
If both sections of pipes has the same slope (i.e. parallel), then, instead of an angle bisector, a line parallel and at equidistance to them must be drawn.
$\bf{\underline{Note\space 3}}\enspace$
We would like to recommend you to post this same question (probably slightly modified to make it more appealing to engineers) at Engineering Stack Exchange to see how the Engineers would respond to it.
