Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[tikz,border=3.14mm]{standalone}
- usepackage{tikz-3dplot}
- usetikzlibrary{3d,shapes.geometric,shadows.blur}
- % small fix for canvas is xy plane at z % https://tex.stackexchange.com/a/48776/121799
- makeatletter
- tikzoption{canvas is xy plane at z}[]{%
- deftikz@plane@origin{pgfpointxyz{0}{0}{#1}}%
- deftikz@plane@x{pgfpointxyz{1}{0}{#1}}%
- deftikz@plane@y{pgfpointxyz{0}{1}{#1}}%
- tikz@canvas@is@plane}
- makeatother
- pgfmathsetmacro{rvec}{4}
- pgfmathsetmacro{thetavec}{30}
- pgfmathsetmacro{phivec}{60}
- begin{document}
- tdplotsetmaincoords{60}{130}
- begin{tikzpicture}[tdplot_main_coords,>=latex,line join=bevel]
- coordinate (O) at (0,0,0);
- draw[thick,->] (O) -- (5,0,0) node[anchor=north east]{$x$};
- draw[thick,->] (O) -- (0,5,0) node[anchor=north west]{$y$};
- draw[thick,->] (O) -- (0,0,5) node[anchor=south]{$z$};
- draw[dashed] (O) -- (-5,0,0);
- begin{scope}[canvas is yz plane at x=5,transform shape]
- node[ellipse,fill=blue,fill opacity=0.7,draw,minimum width=2cm,minimum height=8mm,
- rotate=65] (elliL) at (2,2) {};
- path (elliL.west) -- (elliL.east) coordinate[pos=0.1] (L1b)
- coordinate[pos=0.3] (L1t) coordinate[pos=0.4] (L2b)
- coordinate[pos=0.6] (L2t) coordinate[pos=0.7] (L3b)
- coordinate[pos=0.9] (L3t);
- foreach X in {1,2,3}
- {draw[thick,-latex] (LX b) -- (LX t);}
- coordinate (L) at (2,0);
- end{scope}
- begin{scope}[canvas is yz plane at x=-1,transform shape]
- node[ellipse,fill=blue,fill opacity=0.7,draw,minimum width=2cm,minimum height=8mm,
- rotate=80] (elliR) at (2,2) {};
- path (elliR.west) -- (elliR.east) coordinate[pos=0.1] (R1b)
- coordinate[pos=0.3] (R1t) coordinate[pos=0.4] (R2b)
- coordinate[pos=0.6] (R2t) coordinate[pos=0.7] (R3b)
- coordinate[pos=0.9] (R3t);
- foreach X in {1,2,3}
- {draw[thick,-latex] (RX b) -- (RX t);}
- coordinate (R) at (2,0);
- end{scope}
- %
- tdplotsetcoord{P}{rvec}{thetavec}{phivec}
- node[anchor=south west,color=red] at (P) {$P$};
- draw[-stealth,color=red] (O) -- (P);
- draw[dashed, color=red] (O) -- (Pxy);
- draw[dashed, color=red] (P) -- (Pxy);
- tdplotdrawarc{(O)}{1}{0}{phivec}{anchor=north}{$phi$}
- tdplotsetthetaplanecoords{phivec}
- tdplotdrawarc[tdplot_rotated_coords]{(0,0,0)}{1.5}{0}%
- {thetavec}{anchor=-110}{$theta$}
- %
- pgflowlevelsynccm
- draw[ultra thick,blue!70,latex-latex] (L) -- (R) node[midway,below] {$d$};
- end{tikzpicture}
- end{document}
Add Comment
Please, Sign In to add comment