Image of situation: http://upload.wikimedia.org/wikipedia/commons/5/54/Easement_curve.svg
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.