# find the planar curve that passes two given points, whose tangent directions at these two points are also given

This is related to drawing the links and joints of a robot manipulator. I'd like to find a way to generate a link bwtween two given bars (joints), and the said link has to be normal to the two bars at their connection points.

Mathematically, let's say we pick up two points on the two sides of an angle; when they bear equal distance from the "origin", we can use arc to connect them, satisfying the requirement in the title; but what if the distance are not equal? Is there anyway to generate such a curve? I would like to use that curve to generate a tube using the Tube[] function.

A related question is: I would also like to handle the case when the two given tangent directions and the line connecting the two chosen points are not coplanar; this is related to the case when the axes of the two joints are skew. Is there anyway to generate some curve that satisfies the normality condition at the two points?

I expect that, if we project one line onto the other along the direction of their common perpendicular, then we can use the same procedure for the planar case; after that, we add to the curve a compoenent along the common perpendicular, linear w.r.t. the twist angle between the two lines, then the obtained curve will satisfy the condition. I'm not sure if this is correct or not, though.

Any help is greatly appreciated.

• I'm having a difficult time trying to understand what exactly is being requested. Could you provide a picture perhaps? Maybe a concrete example? – Daniel Lichtblau Jun 18 '20 at 19:57
• @DanielLichtblau, thanks for your comment; the answer from flinty solves my problem. The plot there gives a good idea of what I'm looking for. – larry Jun 19 '20 at 5:40

It sounds to me like you just want a Bézier curve. The curve goes through both pt1 and pt2 and has tangents tangent1 and tangent2 respectively at those points, but I'm fairly sure that in 3D you're not going to get a plane curve unless your tangents also lie in the same plane:

pt1 = {0, 0, 0};
tangent1 = RandomPoint[Sphere[]];
pt2 = {1, 1, 1};
tangent2 = RandomPoint[Sphere[]];
bsf = BezierFunction[{pt1, pt1 + tangent1, pt2 - tangent2, pt2}]
Show[ParametricPlot3D[bsf[t], {t, 0, 1}, PlotRange -> All],
Graphics3D[{Red, PointSize[Large], Point[{pt1, pt2}], Orange,
Arrow[{pt1, pt1 + .33 Normalize[bsf[0] + bsf[0.001]]}],
Arrow[{pt2, pt2 - .33 Normalize[bsf[0.99] - bsf[1]]}]}]
]


• Thanks, this solves the problem. – larry Jun 19 '20 at 5:37