Currently implementing the solution of Curve synthesis - Adding two curves to get another one. I would like to smooth out the resulting curve. The present code:
% red line
\path[red,name path=one] plot [smooth] coordinates {(0,0) (7.5,0) (8,6) (8.5,0) (10,0)};
% function
\path[blue,name path=three]
plot[domain=0:10,samples=100,smooth] (\x,{0.5*rand+2});
% red line + function
\foreach \c in {0,...,100} {
\pgfmathsetmacro{\x}{\c/10}
\path[name path=line] (\x,-10) -- (\x,20);
\path[name intersections={of=one and line,name=newone}];
\path[name intersections={of=three and line,name=newthree}];
\path let \p1=(newone-1), \p2=(newthree-1) in
(\x1,\y1+\y2) coordinate (sum-\c);
}
\draw[blue] (sum-0) \foreach \x in {1,...,100}{ -- (sum-\x)};
What \foreach
syntax should i use instead of:
\draw[blue] (sum-0) \foreach \x in {1,...,100}{ -- (sum-\x)};
to get the list of coordinates [...]
in between braces so that i can do:
\draw[blue] plot [smooth] coordinates{ [...] };