# Connect two curves with Euler spiral segment

Let's say we have a straight line (blue) and a circular arc (green). My goal is to connect these two curves with segment of Euler spiral (red) in such manner that curvature of Euler's spiral at the point where it connects with straight line is equal to zero, (radius is infinite). At the other end, where Euler's spiral connects with circular arc Euler spiral's radius is equal to circular arc radius.

Starting data is straight line end point coordinates (p0), circular arc point (p1), where Euler spiral should meet, coordinates. Circular arc radius.

Problem I am able to draw Euler spiral from start point (p0) till certain radius. But what I need, and I am not able to do is that circular arc and Euler's spiral should meet at certain point (p1) and certain radius as it is shown in the picture above.

I would be grateful if anybody could help me with this problem, I've been struggling with this for a few days now, and ended up in dead end.

-

What you need here is what's termed as a clothoidal spline; in this paper, Meek and Walton devise a (rather elaborate) algorithm that determines a clothoidal spline passing through two given points and matches slopes and curvatures ($G^2$ continuity), under suitable conditions (since not all combinations of slopes and curvatures will yield a feasible clothoidal segment). See also this previous paper for sundry algorithms. All of this assumes that your computing environment is equipped for numerically evaluating Fresnel integrals; there are otherwise simple approximations for computing them if you don't need too much accuracy.