这是我尝试绘制的:
\documentclass[tikz,border=50mm]{standalone}
\usetikzlibrary{calc}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\usetikzlibrary{arrows.meta}
\usepackage{circuitikz}
\usetikzlibrary{decorations.pathmorphing,patterns, snakes}
\usetikzlibrary{arrows, shapes, positioning, calc, decorations.text, angles,
quotes}
\usetikzlibrary{decorations.markings}
\begin{tikzpicture}[scale=2 ,>=stealth]
\foreach \i in {0,2} {
\draw[black, thick] (2,\i) arc [x radius=2, y radius=0.5, start angle=0, end angle=180];
\draw[black, thick] (-2,\i) arc [x radius=2, y radius=0.5, start angle=180, end angle=360];
}
\draw[->] (2,0) arc [start angle=0,end angle=2,x radius=2cm,y radius =1cm] ;
\node[right] at (2.1,0) {$I$};
\draw[<-] (2,2) arc [start angle=2,end angle=4,x radius=2cm,y radius =1cm] ;
\node[right] at (2.1,2) {$I$};
\draw[->] (0,0)--(-2,0) node[midway, above] {$R$};
\draw[->] (0,2)--(-2,2) node[midway, above] {$R$};
\draw[smooth, dashed, ->] (0,-2)--(0,4) node[left] {$z$};
\filldraw[] (0,0)circle(0.025) node[right] {$O_1$};
\filldraw[] (0,2)circle(0.025) node[right] {$O_2$};
\filldraw[] (0,1)circle(0.025) node[left] {$M$};
\filldraw[] (0,3.5)circle(0.025) node[left] {$N$};
\filldraw[] (0,-1.5)circle(0.025) node[left] {$P$};
\draw[smooth, <->] (0.5, 2)--(0.5,3.5) node[right, midway] {$a$};
\draw[smooth, <->] (0.5, 2)--(0.5, 1) node[right, midway] {$d/2$};
\draw[smooth, <->] (0.5, 1)--(0.5,0) node[right, midway] {$d/2$};
\draw[smooth, <->] (0.5, 0)--(0.5,-1.5) node[right, midway] {$b$};
\end{tikzpicture}
这是结果(这并不让我满意)我只是想知道如何才能绘制一个如图所示的带有箭头的椭圆,以及如何才能使它看起来更漂亮?
答案1
这使得圆圈稍微不透明。
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[scale=2 ,>=stealth]
\draw[dashed] (0,-2)--(0,0);% bottom
\filldraw[] (0,-1.5)circle(0.025) node[left] {$P$};
\draw[<->] (0.5, 0)--(0.5,-1.5) node[right, midway] {$b$};
\fill[white, opacity=0.5] (0,0) circle[x radius=2cm,y radius =0.5cm];
\draw[black, thick] (0,0) circle[x radius=2cm,y radius =0.5cm];
\draw[->] (2,0) arc [start angle=0,end angle=2,x radius=2cm,y radius =1cm] ;
\node[right] at (2.1,0) {$I$};
\draw[dashed] (0,0)--(0,2);% middle
\draw[->] (0,0)--(-2,0) node[midway, above] {$R$};
\filldraw[] (0,0)circle(0.025) node[right] {$O_1$};
\draw[<->] (0.5, 1)--(0.5,0) node[right, midway] {$d/2$};
\draw[<->] (0.5, 2)--(0.5, 1) node[right, midway] {$d/2$};
\filldraw[] (0,1)circle(0.025) node[left] {$M$};
\fill[white, opacity=0.5] (0,2) circle[x radius=2cm,y radius =0.5cm];
\draw[black, thick] (0,2) circle[x radius=2cm,y radius =0.5cm];
\draw[<-] (2,2) arc [start angle=2,end angle=4,x radius=2cm,y radius =1cm] ;
\node[right] at (2.1,2) {$I$};
\draw[->] (0,2)--(-2,2) node[midway, above] {$R$};
\draw[dashed, ->] (0,2)--(0,4) node[left] {$z$};% top
\filldraw[] (0,2)circle(0.025) node[right] {$O_2$};
\filldraw[] (0,3.5)circle(0.025) node[left] {$N$};
\draw[<->] (0.5, 2)--(0.5,3.5) node[right, midway] {$a$};
\end{tikzpicture}
\end{document}
此版本使用 tikz-3dplot。如果以单位(cm)指定半径,则将使用屏幕坐标而不是 x,y 平面绘制圆。
\documentclass{standalone}
\usepackage{tikz}% do not use the tikz option of standalone
\usetikzlibrary{arrows.meta}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{75}{0}
\begin{tikzpicture}[tdplot_main_coords, scale=2 ,>=stealth]
\draw[dashed] (0,0,-2)--(0,0,0);% bottom
\filldraw[] (0,0,-1.5) circle(0.025cm) node[left] {$P$};
\draw[<->] (0.5,0, 0)--(0.5,0,-1.5) node[right, midway] {$b$};
\fill[white, opacity=0.5] (0,0,0) circle[radius=2];
\draw[black, thick] (0,0,0) circle[radius=2];
\draw[thick, ->] (2,0,0) --(2,0.2,0);
\node[right] at (2.1,0,0) {$I$};
\draw[dashed] (0,0,0)--(0,0,2);% middle
\draw[->] (0,0,0)--(-2,0,0) node[midway, above] {$R$};
\filldraw[] (0,0,0) circle(0.025cm) node[right] {$O_1$};
\draw[<->] (0.5,0, 1)--(0.5,0,0) node[right, midway] {$d/2$};
\draw[<->] (0.5,0, 2)--(0.5,0, 1) node[right, midway] {$d/2$};
\filldraw[] (0,0,1) circle(0.025cm) node[left] {$M$};
\fill[white, opacity=0.5] (0,0,2) circle[radius=2];
\draw[black, thick] (0,0,2) circle[radius=2];
\draw[thick, ->] (2,0,2) -- (2,-0.2,2);
\node[right] at (2.1,0,2) {$I$};
\draw[->] (0,0,2)--(-2,0,2) node[midway, above] {$R$};% top
\draw[dashed, ->] (0,0,2)--(0,0,4) node[left] {$z$};% top
\filldraw[] (0,0,2) circle(0.025cm) node[right] {$O_2$};
\filldraw[] (0,0,3.5) circle(0.025cm) node[left] {$N$};
\draw[<->] (0.5,0, 2)--(0.5,0,3.5) node[right, midway] {$a$};
\end{tikzpicture}
\end{document}