我有以下代码来绘制一个弧线,然后绘制一个垂直于该曲线的速度矢量。我想在绿色箭头周围画一个透明圆柱体,最简单的方法是什么?也就是说,让箭头穿过圆柱体的顶部。
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[>=Triangle]
\shade [top color=white, bottom color=gray!50, middle color=white]
(120:8/3) arc (120:190:8/3) node [black, near end, left] {$\omega$}
-- (190:25/9) -- (200:15/6) -- (190:20/9) -- (190:7/3)
arc (190:120:7/3) -- cycle;
\foreach \i in { 210}{
\draw [->, thick, blue!50!cyan] (\i-65:2) arc (\i-65:\i+60:2);
\tikzset{shift={(\i:2)}, rotate=\i+180}
\draw [->, very thick, orange] (0,0) -- (1,0)
node [black, near end, anchor=\i+90] {$\vec a$};
\draw [->, very thick, green!50!black] (0,0) -- (0,-2)
node [black, near end, anchor=\i+180] {$\vec v$};
\fill circle [radius=1/10];
}
\end{tikzpicture}
\end{document}
答案1
像这样:
代码:
\documentclass[border=0.2cm]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=2]
\fill[draw=orange!50,fill=orange!50] (-3,-1) rectangle (0.5,1);
\filldraw[fill=orange!20] (-3,0) ellipse (0.5 and 1);
\fill[fill=orange!50] (.5,-1) arc(-90:90:.5 and 1);
\draw[line width=5pt, red] (-4,0) -- (-2.5,0);
\draw[-latex,line width=5pt, red] (1,0) -- (2,0);
\end{tikzpicture}
\end{document}
添加:如果您想要这样的东西:
只修改图片环境的第一行:
\begin{tikzpicture}[scale=2,rotate=30]