这是来自如何画山的样子
我想添加尾部以及它的开头和结尾。
我不确定如何添加,即使我已经阅读了代码。
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}[>=stealth]
\draw[very thick,name path=hills] (0,0) coordinate(O) -- ++ (65:5)
to[out=65,in=180] (3.5,6) coordinate[label=above:$A$] (A)
to[out=0,in=180,looseness=0.4] ++ (2.25,-5.5) coordinate (v1)
to[out=0,in=180,looseness=0.4] ++ (2.5,3.5) coordinate[label=above:$C$] (C)
to[out=0,in=180,looseness=0.4] ++ (1.75,-1.75) coordinate (v2)
to[out=0,in=180,looseness=0.5] ++ (2.5,2.5) coordinate[label=above:$B$] (B)
to[out=0,in=110,looseness=0.4] ++ (1.2,-1.75)
-- (15,0) coordinate (F);
\draw[thick,blue,shorten >=2mm,shorten <=2mm] (O) -- (F);
\foreach \X/\Y in {A/O,B/v1,C/v2}
{\draw[thick,latex-latex] (\X) -- node[midway,fill=white] {$\X$} (\X|-\Y);}
\path[name path=v1] (v1) -- (F|-v1);
\draw[dashed,name intersections={of=hills and v1}] (v1) -- (intersection-2);
\path[name path=v2] (v2) -- (O|-v2);
\draw[dashed,name intersections={of=hills and v2}] (v2) -- (intersection-3);
\end{tikzpicture}
\end{document}
答案1
怎么样
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}[>=stealth]
\draw[very thick,name path=hills] (-0.5,0.5) to[out=-60,in=180,looseness=0.5] (0,0) coordinate(O)
to[out=0,in=-120,looseness=0.5] ++ (65:5)
to[out=65,in=180] (3.5,6) coordinate[label=above:$A$] (A)
to[out=0,in=180,looseness=0.4] ++ (2.25,-5.5) coordinate (v1)
to[out=0,in=180,looseness=0.4] ++ (2.5,3.5) coordinate[label=above:$C$] (C)
to[out=0,in=180,looseness=0.4] ++ (1.75,-1.75) coordinate (v2)
to[out=0,in=180,looseness=0.5] ++ (2.5,2.5) coordinate[label=above:$B$] (B)
to[out=0,in=110,looseness=0.4] ++ (1.2,-1.75)
to[out=-70,in=180,looseness=0.5] (15,0) coordinate (F)
to[out=0,in=-120,looseness=0.5] ++ (0.5,0.5);
\draw[thick,blue,shorten >=0.4pt,shorten <=0.4pt] (O) -- (F);
\foreach \X/\Y in {A/O,B/v1,C/v2}
{\draw[thick,latex-latex] (\X) -- node[midway,fill=white] {$\X$} (\X|-\Y);}
\path[name path=v1] (v1) -- (F|-v1);
\draw[dashed,name intersections={of=hills and v1}] (v1) -- (intersection-2);
\path[name path=v2] (v2) -- (O|-v2);
\draw[dashed,name intersections={of=hills and v2}] (v2) -- (intersection-3);
\end{tikzpicture}
\end{document}