Solution A
This solution provides two TikZ styles:
next angle that does what you want:
- using the provided angle advanced by 180 degrees as the
in angle (at the next coordinate)
- using the angle saved the last time
next angle was used as the out angle
- saving the provided
next angle angle in the \nextAngle macro, but so that it gets set after the current to path is calculated and the macro is available for the next to path.
start angle is simply a clone of out. Additionally it sets \nextAngle so that it can be used before next angle.
The order next angle → start angle/out does work, too, but not out → next angle.
Code
\documentclass[tikz]{standalone}
\def\nextAngle{0}
\tikzset{
next angle/.style={
in=#1+180,
out=\nextAngle,
prefix after command= {\pgfextra{\def\nextAngle{#1}}}
},
start angle/.style={
out=#1,
nangle=#1,
},
nangle/.code={% used only internally
\def\nextAngle{#1}
}
}
\begin{document}
\begin{tikzpicture}
\draw (0,0) to[out=10, in=70-180] (1,1)
to[out=70, in=0-180] (2,2)
to[out=0, in=-50-180] (3,0);
\end{tikzpicture}
\begin{tikzpicture}
\draw (0,0) to[start angle=10,next angle=70] (1,1)
to[next angle=0] (2,2)
to[next angle=-50] (3,0);
\end{tikzpicture}
\end{document}
Output

Solution B (“Area 51”)
This solution provides some TikZ styles:
start angle is only a clone of out.
next angle does what you want:
- using the provided angle advanced by 180 degrees as the
in angle (at the next coordinate)
- saving the provided
next angle angle to be used at the next to path as the out angle (this has great repercussions, because it also sets the curve to style—which is the underlying to path of out and in—in a way that it is used even at tos that are not specified in any way).
last angle is a clone of in but with the customization that 180 degrees are added. In addition the style line to will be set so that the next to will revert to its normal behaviour (see note above).
last angle simple is like last angle except that line to will not be set.
Note: The default to is the same as -- (meaning: whatever my code does, -- will always work).
The differences between the last three styles may better be seen in the example given below.
I fear that this approach does mess too much with to path and curve to. Therefore, I think that solution A is better.
Code
\documentclass[tikz]{standalone}
\def\nextAngle{0} % old solution
\tikzset{
next angle/.style={
in=#1+180,
prefix after command={\pgfextra{\tikzset{out=#1}}}
},
start angle/.style={out=#1},
last angle/.style={
in=#1+180,
prefix after command={\pgfextra{\tikzset{line to}}} % revert to default to path
},
last angle simple/.style={in=#1+180}
}
\begin{document}
\begin{tikzpicture}
\fill[black!15] (-.5,-1) rectangle (4.5,4);
\coordinate (a) at (0,0); \coordinate (b) at (1,1);
\coordinate (c) at (2,2); \coordinate (d) at (3,0);
\coordinate (e) at (3,3);
\draw[very thick,black] (a) to[start angle=10,next angle=70] (b)
to[next angle=0] (c)
to[next angle=-50] (d)
to (e); % uses out=-50
\draw[green!70!black] (a) to[start angle=10,next angle=70] (b)
to[next angle=0] (c)
to[last angle=-50] (d)
to (e);
\draw[blue] (a) to[start angle=10,next angle=70] (b)
to[next angle=0] (c)
to[last angle simple=-50] (d) to (e);
\foreach \c in {a,...,e}{
\fill[fill=red,opacity=.8] (\c) circle[radius=2pt] node[below] {\c};
}
\end{tikzpicture}
\end{document}
Output
Legend:
- thick, black:
next angle=-50 at the second to last to
- blue:
last angle=-50 at the second to last to
- green:
last angle simple=-50 at the second to last to
