0

How can I draw this diagram using TikZ?

Image

I would preferably want both the arrows and the annotations on the arrows please

  • Welcome to TeX.SE. Just have you tried something? – Sebastiano Mar 28 at 21:48
5

This is a start. Use 3d spherical coordinates and plot all sorts of things. The missing two annotations are left as an exercise for the reader.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3d,perspective} 
\begin{document}
\begin{tikzpicture}[3d view={30}{30},>=stealth]
 \draw plot[domain=1.5:2] (xyz spherical cs:radius=\x,latitude=-20,longitude=-20)
 plot[domain=-20:20] (xyz spherical cs:radius=2,latitude=20,longitude=\x)
  --  plot[domain=20:-20] (xyz spherical cs:radius=2,latitude=\x,longitude=20)
  -- plot[domain=20:-20] (xyz spherical cs:radius=2,latitude=-20,longitude=\x)
  --  plot[domain=-20:20] (xyz spherical cs:radius=2,latitude=\x,longitude=-20)
  -- cycle
  plot[domain=2:1.5] (xyz spherical cs:radius=\x,latitude=20,longitude=-20)
  --  plot[domain=20:-20] (xyz spherical cs:radius=1.5,latitude=\x,longitude=-20)
  --  plot[domain=-20:20] (xyz spherical cs:radius=1.5,latitude=-20,longitude=\x)
  -- plot[domain=1.5:2] (xyz spherical cs:radius=\x,latitude=-20,longitude=20);
 \draw[->] (xyz spherical cs:radius=2,latitude=0,longitude=0) 
  -- (xyz spherical cs:radius=3,latitude=0,longitude=0) node[right]{$\sigma_r$};
 \foreach \Z in {1,-1} 
 {\foreach \X in {-10,0,10} 
  { \draw[->] plot[domain=25:40] (xyz spherical
        cs:radius=2,latitude=\Z*\X,longitude=\Z*\x);
    \draw[->] plot[domain=25:40] (xyz spherical
        cs:radius=2,latitude=\Z*\x,longitude=\Z*\X);}}
\end{tikzpicture}
\end{document}

enter image description here

Or a more fancy version.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3d,perspective,arrows.meta,bending} 
\begin{document}
\begin{tikzpicture}[3d view={30}{30},>={Stealth[bend]},samples=4,smooth,
    line cap=round,line join=round,
    declare function={R=2;dR=0.5;phimin=-20;phimax=20;thetamin=-20;thetamax=20;}]
 \draw[left color=gray!20,right color=gray!40,middle color=gray!15,shading
 angle=55] 
 plot[domain=phimin:phimax] (xyz spherical cs:radius=R,latitude=thetamax,longitude=\x)
  --  plot[domain=thetamax:thetamin] (xyz spherical cs:radius=R,latitude=\x,longitude=phimax)
  -- plot[domain=phimax:phimin] (xyz spherical cs:radius=R,latitude=thetamin,longitude=\x)
  --  plot[domain=thetamin:thetamax] (xyz spherical cs:radius=R,latitude=\x,longitude=phimin)
  -- cycle;
\draw[left color=gray,right color=black,middle color=gray!80,shading
 angle=75] 
  plot[domain=R:R-dR] (xyz spherical cs:radius=\x,latitude=20,longitude=phimin)
  --  plot[domain=thetamax:thetamin] (xyz spherical cs:radius=R-dR,latitude=\x,longitude=phimin)
  -- plot[domain=R-dR:R] (xyz spherical cs:radius=\x,latitude=-20,longitude=phimin)
  --  plot[domain=thetamin:thetamax] (xyz spherical cs:radius=R,latitude=\x,longitude=phimin);
\draw[fill=black]  
  plot[domain=R:R-dR] (xyz spherical cs:radius=\x,latitude=thetamin,longitude=-20)
  --  plot[domain=phimin:phimax] (xyz spherical cs:radius=R-dR,latitude=thetamin,longitude=\x)
  -- plot[domain=R-dR:R] (xyz spherical cs:radius=\x,latitude=thetamin,longitude=20)
  --  plot[domain=phimax:phimin] (xyz spherical cs:radius=R,latitude=thetamin,longitude=\x);
 \draw[->] (xyz spherical cs:radius=R,latitude=0,longitude=0) 
  -- (xyz spherical cs:radius=R+1.5,latitude=0,longitude=0) node[right]{$\sigma_r$};
 \foreach \Z in {1,-1} 
 {\foreach \X in {-10,0,10} 
  { \draw[->] plot[samples at={25,30,35,45}] (xyz spherical
        cs:radius=2,latitude=\Z*\X,longitude=\Z*\x);
    \draw[->] plot[samples at={25,30,35,45}] (xyz spherical
        cs:radius=2,latitude=\Z*\x,longitude=\Z*\X);}}
 \path (1,2) node[right] {$\sigma_L$} (-1.2,3) node[above left]{$\sigma_\theta$};       
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |
  • 2
    @levivah940 latitude=0,latitude=0 brings you in the middle of the diagram. Use e.g. \path (1,2) node[right] {$\sigma_L$} (-1.2,3) node[above left]{$\sigma_\theta$}; – user194703 Mar 29 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy