Skip to content

Instantly share code, notes, and snippets.

@duetosymmetry
Created March 3, 2023 04:08
Show Gist options
  • Save duetosymmetry/a4a2f9b5d6774215e0a1dced3b245cd1 to your computer and use it in GitHub Desktop.
Save duetosymmetry/a4a2f9b5d6774215e0a1dced3b245cd1 to your computer and use it in GitHub Desktop.
TikZ code for making my figure showing the geometry for discussing multipole expansion
\documentclass[crop,tikz]{standalone}
\usepackage{bbm,bm}
\usetikzlibrary{arrows.meta,bending,positioning,shapes.symbols}
\begin{document}
\begin{tikzpicture}[>=Stealth]
\node[cloud, draw,
fill = gray!10,
minimum width = 6cm,
minimum height = 4cm] (c) at (0.5,0.5) {};
\draw[<->] (-2.5,-2) -- (3.5, -2) node[midway, below] {$d$};
\draw[->] (xyz cs:x=0) -- (xyz cs:x=1);
\draw[->] (xyz cs:y=0) -- (xyz cs:y=1);
\draw[->] (xyz cs:z=0) -- (xyz cs:z=1);
\coordinate (xvec) at (-10:8);
\coordinate (xpvec) at (30:2);
\draw[->, thick, blue] (0,0) -- (xpvec)
node[above, text=black] {$\boldsymbol{x}'$}
node[midway, above, text=black] {$r'$};
\draw[->, thick, blue] (0,0) -- (xvec)
node[right, text=black] {$\boldsymbol{x}$}
node[midway, below, text=black] {$r$};
\draw[->, green] (xpvec) -- (xvec) node[midway, above, text=black] {$\boldsymbol{x}-\boldsymbol{x}'$};
\draw[<->, orange] (-10:1.5) arc (-10:30:1.5)
node [midway, right, text=black] {$\gamma$};
\node at (-1,.5) {$\rho(\boldsymbol{x})\neq 0$};
\node at (5,1.5) {$\rho(\boldsymbol{x})= 0$};
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment