Say I have two points $A$ and $B$ in an $(x,y)$ plane and tangents of the points which are normalised vectors $\mathrm{dir} A$ $\mathrm{dir} B$, how do you find a path made of two arcs that join them together?

Here is a visual of what I mean. Since the images are not clear, the grey vectors from the two tangents are equal in magnitude but the magnitude is unknown.

enter image description here

Note: I am looking for perfect arcs not cubic bezier curves.

  • $\begingroup$ assuming the directions are normalized, in order to find the segments that act as guides you need to solve $|(A+a \times dirA)-(B-b \times dirB)|=a+b$, where a is the length of the segment that starts from A and b is the length of the segments that ends in B (there could be two solutions, but if the initial directions are oriented along the path like you show in the picture you should exclude the negative solution) $\endgroup$
    – sortai
    Apr 13, 2020 at 8:01
  • $\begingroup$ There is a full explanation here: ryanjuckett.com/biarc-interpolation Didn't you actually take the images from there?? $\endgroup$ Jun 23, 2022 at 20:09

1 Answer 1


Geogebra drawing

Say that you have a line $a$ defined by two points, $A$ and $A'$, and a line $b$ defined by points $B$ and $B'$. In my Geogebra drawing you can adjust directions of lines $a,b$ by moving points $A'$ and $B'$. You want to create a smooth curve APB made of two circular arcs, $AP$ and $PB$, so that arc $AP$ is tangent to line $a$ at point $A$ and arc $PB$ is tangent to line $b$ at point $B$.

First of all, if nothing else is given, there are infinitely many solutions. I will show that exactly one solution can be obtianed by fixing point $D$ on line $a$ so that line $DPE$ is tangent to both arcs at point $P$.

Introduce $F=a\cap b$. I will discuss only one case

  • when point $F$ exists ($a \not\parallel b$)
  • point $D$ is between $F$ and $A$
  • point $E$ is between $F$ and $B$

Other cases can be discussed in a similar way.

enter image description here

The followin lengths and angle are known:

$p=FA, q=FB, x=FD, \alpha=\angle AFB$

The only problem is to calculate $y=FE$. Note that:


On the other side:

$$DE^2=FD^2+FE^2-2FD\cdot FE \cos\angle AFB\tag{1}$$






$$FE=y=\frac{p+q}{2}\ \frac{p+q-2x}{p+q-x(1+\cos\alpha)}$$

Now that you have point $E$, finding point P is easy (because $DP=DA,EP=EB$).

Center of arc AP can be found by intersecting line perpendicular to $DP$ at $P$ and bisector of angle $PDA$. In a similar way you can find the center of arc $BP$ (construction not shown).

You can play with my Geogebra drawing by moving lines $a$ and $b$ and adjusting position of point $D$. Basically, you can play with blue dots.

enter image description here

Other cases, for example, when $A$ is between $F$ and $D$ are also interesting. I'll leave detailed analysis up to you:

enter image description here

enter image description here


In the meantime WDUK added another condition:


In this case, by applying cosine theorem (1) to triangle $FDE$ we get the following equation:


The solutions are:



...and therefore we have two possible solutions, $APB$ and $AQB$:

enter image description here



Another example:

$$FA=p,\ FB=q,\ AD=DP=PE=BE=z$$

In this case, by applying cosine theorem (1) to triangle $FDE$ we get the following equation:


The positive solution of this quadratic equation is:


This defines positions of points $D$ and $E$. The rest of the construction is trivial.

enter image description here

  • $\begingroup$ You mention the following lengths are known x = FD but you never showed how to calculate the position of D. Since from what i gather you find D from knowing where P is tangent to the two arcs, but we don't know the two arcs yet either. I should mention (don't know if this simplifies the math) but from my original image, AD and BE are to be assumed equal in magnitude which gives a constraint to guarantee only one solution. $\endgroup$
    – WDUK
    Apr 16, 2020 at 19:42
  • $\begingroup$ @WDUK You are changing the description of the problem a LOT! You should have mentioned that DP should be equal to PE. I had to limit the number of solutions somehow and I did that by choosing point D arbitrarily. You are talking about a completely different problem now. $\endgroup$
    – Saša
    Apr 16, 2020 at 19:57
  • $\begingroup$ I thought the images made it clear the grey vectors from the tangents were equal in magnitude. Which was why they were drawn in. Maybe i should've made it more clear in the images. $\endgroup$
    – WDUK
    Apr 16, 2020 at 20:11
  • $\begingroup$ @WDUK It just looks so. If it's not mentioned, it cannot be guessed. I'll try to provide a new answer. $\endgroup$
    – Saša
    Apr 16, 2020 at 20:12
  • 1
    $\begingroup$ I've noticed, all your tangents are counter pointing to each other. So they don't form one continuous path from A to B (or B to A). Instead they point in a direction that would lead to a meeting point at the middle of the two arcs (P or Q). For example your tangents match the top right example in my question but your solution does not follow the directions, its only finding arcs that match tangents. You can't reach B via AQB since the tangent points the wrong way (you would be going the wrong way around blue arc). You can't reach B from P since A's direction is the other way. Make sense? $\endgroup$
    – WDUK
    Apr 16, 2020 at 21:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .