1

I am trying to find the tangent that is common to two quadratic Bezier curves.

Concretely, I want to draw the corner of a bending piece of paper, like this:

enter image description here

Theoretically it looks simple: Given a Bezier curve $B$ through points $P_0$, $P_1$ and $P_2$, and another one $G$ though $Q_0$, $Q_1$, $Q_2$, i.e.: $$ B(t) = (1-t)^2P_0 + 2t(1-t)P_1 + t^2P_2 $$$$ G(r) = (1-r)^2Q_0 + 2r(1-r)Q_1 + r^2Q_2 $$$$ 0 \leq t, r \leq 1 $$ , I am looking for a solution $(r,t)$ of this system: $$ B'(t) \cdot G'(r) = 0 $$$$ (G(r) - B(t)) = \lambda B'(t) $$ , that is: the tangent vectors are parallel and the vector between the tangent points is on the tangent.

I first spent a couple hours on paper isolating $r$ in the first and substituting in the second, but I gave up given the number of terms that came up. Then I used Maple to help me do the calculation, and even it cannot tract it. I found answers online that gave roughly the same idea that I have here, but no calculation is ever done.

My question: It there a more clever way to approach the problem, any transformation that would make the algebra simpler?

N.B.

  • A numeric approximation is enough for my application. I tried a Taylor expansion in Maple, with no success.
  • I am actually interested in an application where $P_2 = Q_0$, not sure if it really matters.
  • I am interested in other ways to draw what I want, but I spent so much time trying to solve the equations above that now I'd like to see a math solution anyway.
JulienD
  • 168
  • The equations you need to solve are (B(t) - G(r)) x B'(t) = 0 and (B(t) - G(r)) x G'(r) = 0. This means the common tangent line is parallel to the tangent vectors at the two tangent points. – fang Jun 18 '20 at 17:56
  • @fang Thanks, it makes it more elegant. When I try to solve it in Maple, though, it prints hundreds of terms just to isolate $r$, and cannot solve the system ("too many terms"). I guess I will resort to use numeric multivariate root finding methods. – JulienD Jun 18 '20 at 20:55
  • Well I got up to the "very messy" part and gave up eventually, but I believe it does. – JulienD Jan 10 '21 at 12:10

0 Answers0