我想在 LaTex 中画一个简单的船形,有人知道有什么好办法吗?TikZ 是最适合这个的软件包吗?我希望它看起来类似于下图中的船,我觉得它似乎是用 TikZ 制作的。有什么想法可以实现吗?
答案1
一艘船!无法抗拒。
这应该可以帮助你入门。
\documentclass[tikz,border=4mm]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}[x=0.5cm,y=0.5cm,thick,line cap=round]
\draw (0,4) -- (4,0) -- +(0,-2);
\draw (4,-2) to[out=180,in=-90,looseness=1.2] (0,4);
\draw (0,4) to [out=50,in=190,looseness=0.8] (14,14);
\draw (4,0) to [out=40,in=260,looseness=0.8] (14,14);
\draw (4,-2) to [out=40,in=280,looseness=0.8] (14,14);
\draw[name path=a,line width=1pt, -latex] (0,0) -- (16,16)
node[pos=0.9,inner sep=3mm] (x) {}
node[pos=1.02] {$x_b$};
\draw[name path=b,line width=1pt, -latex] (0,14) -- (14,0) node[pos=1.02] {$y_b$};
\path[name intersections={of=a and b,by={I}}];
\draw[line width=1pt,dashed, -latex] (I)node[right,font=\tiny] {CoG} -- +(0,-5cm)
node[pos=1.02] {$z_b$};
\draw[-latex] (x.north west) to[out=110,in=-20,looseness=5] (x.south east);
\node[right,font=\tiny] at ([xshift=5mm]x.east) {roll $p$};
\end{tikzpicture}
\end{document}