Biarc

A biarc is a smooth curve formed from two circular arcs. In order to make the biarc smooth (G1 continuous), the two arcs should have the same tangent at the connecting point where they meet.

Biarcs are commonly used in geometric modeling and computer graphics. They can be used to approximate splines and other plane curves by placing the two outer endpoints of the biarc along the curve to be approximated, with a tangent that matches the curve, and then choosing a middle point that best fits the curve. This choice of three points and two tangents determines a unique pair of circular arcs, and the locus of middle points for which these two arcs form a biarc is itself a circular arc. In particular, to approximate a Bézier curve in this way, the middle point of the biarc should be chosen as the incenter of the triangle formed by the two endpoints of the Bézier curve and the point where their two tangents meet. More generally, one can approximate a curve by a smooth sequence of biarcs; using more biarcs in the sequence will in general improve the approximation's closeness to the original curve.

Examples of biarc curves
  In the below examples biarcs $$A(J)B$$ are subtended by the chord $$AB,$$ and $$J$$ is the join point. Tangent vector at the start point $$A$$ is $$\mathbf{n}(\alpha)$$, and $$\mathbf{n}(\beta)$$ is the tangent at the end point $$B:$$

  Fig. 2 shows six examples of biarcs $$AJB.$$   Fig. 3 shows two examples of biarc families, sharing end points and end tangents.   Fig. 4 shows two examples of biarc families, sharing end points and end tangents, end tangents being parallel: $$\alpha=\beta.$$   Fig. 5 shows specific families with either $  
 * Biarc 1 is drawn with $$\alpha=100^\circ,\;\beta=30^\circ.$$ Biarcs 2-6 have $$\alpha=100^\circ,\;\beta=-30^\circ.$$
 * In examples 1, 2, 6 curvature changes sign, and the join point $$J$$ is also the inflection point. Biarc 3 includes the straight line segment $$JB$$.
 * Biarcs 1–4 are short in the sense that they do not turn near endpoints. Alternatively, biarcs 5,6 are long: turning near one of endpoints means that they intersect the left or the right complement of the chord to the infinite straight line.
 * Biarcs 2–6 share end tangents. They can be found in the lower fragment of Fig. 3, among the family of biarcs with common tangents.

Different colours in figures 3, 4, 5 are explained below as subfamilies $$\color{sienna}\mathcal{B}^{\,+}$$, $$\color{blue}\mathcal{B}^{\,-}_1$$, $$\color{green}\mathcal{B}^{\,-}_2$$. In particular, for biarcs, shown in brown on shaded background (lens-like or lune-like), the following holds:
 * the total rotation (turning angle) of the curve is exactly $$\beta-\alpha$$ (not $$\beta-\alpha\pm 2\pi$$, which is the rotation for other biarcs);
 * $$\sgn(\alpha+\beta)=\sgn(k_2-k_1)$$: the sum $$\alpha+\beta$$ is the angular width of the lens/lune, covering the biarc, whose sign corresponds to either increasing (+1) or decreasing curvature (−1) of the biarc, according to generalized Vogt's theorem (Теорема Фогта#Обобщение теоремы).

Family of biarcs with common end tangents
A family of biarcs with common end points $$A = (-c,0)$$, $$B = (c,0)$$, and common end tangents (1) is denoted as $$\mathcal{B}(p;\,\alpha,\beta,c),$$ or, briefly, as $$\mathcal{B}(p),$$ $$p$$ being the family parameter. Biarc properties are described below in terms of article.

  Constructing of a biarc is possible if

  Denote
 * $$k_1$$, $$\theta_1$$ and $$L_1$$ the curvature, the turning angle and the length of the arc $$AJ$$:    $$\theta_1 = k_1 L_1$$;
 * $$k_2$$, $$\theta_2$$ and $$L_2$$ the same for the arc $$JB$$:    $$\theta_2=k_2L_2$$.

Then $$k_1(p) = -\frac 1 c \left(\sin\alpha+p^{-1}\sin\omega\right),\quad k_2(p) = \frac 1 c \left(\sin\beta+p\sin\omega\right),\quad\text{where}\quad \omega=\frac{\alpha+\beta}2$$ (due to $$, $$\sin\omega\not=0$$). Turning angles: $$  \theta_1(p)=2\arg\left(e^{-i\alpha} +p^{-1}{e^{-i\omega}}\right),\quad \theta_2(p)=2\arg\left(e^{ i\beta } +p\,  e^{i\omega}\right). $$ </li> <li> The locus of join points $$J$$ is the circle $$  X_J(p)=\frac{c(p^2-1)},\quad Y_J(p)=\frac{2cp\sin\gamma}{p^2+2p\cos\gamma+1},\quad\text{where}\quad \gamma=\frac{\alpha-\beta}2 $$ (shown dashed in Fig.3, Fig.5). This circle (straight line if $$\gamma=0$$, Fig.4) passes through points $$A,B,$$ the tangent at $$A$$ being $$\mathbf{n}(\gamma).$$ Biarcs intersect this circle under the constant angle $$-\omega.$$ </li> <li> Tangent vector to the biarc $$\mathcal{B}(p)$$ at the join point is $$\mathbf{n}\left(\tau_{{}_J}\right)$$, where $$ \tau_{\scriptscriptstyle J}(p)={-2} \arctan \dfrac{p\sin\frac{\alpha}2+\sin\frac{\beta}2}{p\cos\frac{\alpha}2+\cos\frac{\beta}2}. $$ </li>

<li> Biarcs with $$p = \pm1$$ have the join point on the Y-axis $$(X_J=0),$$ and yield the minimal curvature jump, $$\min\left|k_2(p)-k_1(p)\right|,$$ at $$J.$$ </li>

<li> Degenerate biarcs are: p^\ast= \begin{cases} -\dfrac{\sin\omega}{\sin\alpha}, & \text{if}\; |\alpha|\geqslant|\beta|\quad(|\alpha|=\pi\;\Longrightarrow\; p^\ast=-\infty),\\[1ex] -\dfrac{\sin\beta}{\sin\omega}, & \text{if}\; |\alpha|\leqslant|\beta|\quad(|\beta|=\pi\;\Longrightarrow\; p^\ast=0). \end{cases} $$ Darkened lens-like region in Figs.3,4 is bounded by biarcs $$\mathcal{B}(0),\,\mathcal{B}(\infty).$$ It covers biarcs with $$p>0.$$
 * Biarc $$\mathcal{B}(0)$$: as $$p \to 0$$, $$J(p) \to A$$, arc $$AJ$$ vanishes.
 * Biarc $$\mathcal{B}(\infty)$$: as $$p \to \pm\infty$$, $$J(p) \to B$$, arc $$JB$$ vanishes.
 * Discontinuous biarc $$\mathcal{B}(p^\ast)$$ includes straight line $$AP_\infty J$$ or $$JP_\infty B,$$ and passes through the infinite point $$P_\infty$$: $$

Discontinuous biarc is shown by red dash-dotted line. </li> <li> The whole family $$\mathcal{B}(p;\,\alpha,\beta,c)$$ can be subdivided into three subfamilies of non-degenerate biarcs: $$ \begin{array}{l} \mathcal{B}^{\,+}(p){:}\quad p\in(0;\infty);\\ \mathcal{B}^{\,-}_1(p){:}\quad p\in(p^\ast;0);\\ \mathcal{B}^{\,-}_2(p){:}\quad p\in(-\infty;p^\ast);\\ \left[\mathcal{B}^{\,-}(p) = \mathcal{B}^{\,-}_1(p) \cup \mathcal{B}^{\,-}_2(p)\right]. \end{array} $$

Subfamily $$\mathcal{B}^{\,-}_1$$ vanishes if $$p^\ast=0$$  $$(|\beta|=\pi).$$

Subfamily $$\mathcal{B}^{\,-}_2$$ vanishes if $$p^\ast=-\infty$$ $$(|\alpha|=\pi).$$

In figures 3, 4, 5 biarcs $$\color{sienna}\mathcal{B}^{\,+}$$ are shown in brown, biarcs $$\color{blue}\mathcal{B}^{\,-}_1$$ in blue, and biarcs $$\color{green}\mathcal{B}^{\,-}_2$$ in green. </li> </ol>