答案1
该hobby
库允许您绘制平滑曲线,并指定某些点的切线。此示例实际上来自其非常出色的手册。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{hobby}
\begin{document}
\begin{tikzpicture}[use Hobby shortcut,
tangent/.style={%
in angle={(180+#1)} ,
Hobby finish ,
designated Hobby path=next , out angle=#1,
}, ]
\draw[help lines] (-5,-5) grid (5,5);
\draw (-5,0) -- (5 ,0) (0,-5) -- (0 ,5) ;
\draw[ thick ] (-5,2) .. ([ tangent=0]-3,3) .. (-1,1) ..
(0,-1.3) .. ([tangent=0]1,-2) .. ([tangent=45]2,-1.5) ..
([tangent=0]3,-2) .. (5,-4);
\end{tikzpicture}
\end{document}