# Tikz drawing incoming and out going arrows in Physics

In doing Physics drawings often times we have to the depict a vector that is perpendicular to the plane of drawing. If it's going in we can draw it with $\otimes$, which for me is good enough. But the best out going arrow tip symbol I could find is $\bigodot$, which doesn't seem very nice. The inner filled circle seems too small. Instead I can use in tikz something like

\fill [color=black] (-3, 0) circle(0.1);
\draw [color=black, thick] (-3, 0) circle(0.25);


but I think it's too verbose.

Here's the code:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary {positioning}
\usepgfmodule{decorations}
\usetikzlibrary{decorations.markings}
\usepackage{bm} %boldfaced math symbols
\begin{document}
\begin{tikzpicture}[scale=0.6, decoration={
markings,
mark=at position 0.5 with {\arrow{latex}}}]
\def\x{2.5}
\def\X{7.6}
\def\y{-1}
\def\Y{1}
\draw[blue] (.5, 0.4*\y)--(18.5, 0.4*\y);
\draw[blue] (.5, 0.4*\Y)--(18.5, 0.4*\Y);
\foreach \x in {1,..., 18} {
\draw [blue] (\x, 0) node {$\bm\bigodot$};
}
% Amperiana intermediaria
\draw[color=red,  postaction={decorate}] (\X, \Y)--(\x, \Y) ;
\draw[color=red,  postaction={decorate}] (\x, \y)--(\X, \y);
\draw[red, postaction={decorate}] (\X, \y)--(\X, \Y) node[below right]
{$c$};
\draw[red, postaction={decorate}] (\x, \Y) -- (\x, \y);
\draw[ <->] (\x, 1.3*\Y) -- (\X, 1.3*\Y) node[midway, above] {$\ell$};
\draw[blue]  (10, 0.7) node {$\vec\kappa$};
\draw[red, -latex]  (11, 2.0) -- (10, 2) node [above] {$\vec B$};
\draw[red, -latex]  (10, -2.0) -- (11, -2) node [above] {$-\vec B$};
\draw[red, -latex]  (17, 1.0) --++ (1, 0) node [below] {$x$};
\draw[red, -latex]  (17, 1.0) --++ (0, 1) node [left] {$y$};
\filldraw[white] (17, 1.0) circle (0.2) node[red] {\small$\bm\bigodot$};
\draw[red] (17, 1.0) node[left=0.1] {$z$};
\end{tikzpicture}
\end{document}


Here's the outcome:

Any simple alternative to $\bigodot$?

A tikz pic can work very similar to a node. So, you can define your own picture like this:

\tikzset{fieldout/.pic={
\fill circle(0.1);
\draw [thick] circle(0.25);
}
}


and use it wherever you want in the code similar to how you use a node.

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary {positioning}
\usepgfmodule{decorations}
\usetikzlibrary{decorations.markings}
\usepackage{bm} %boldfaced math symbols

\tikzset{fieldout/.pic={
\fill circle(0.1);
\draw [thick] circle(0.25);
}
}

\begin{document}

\begin{tikzpicture}[scale=0.6, decoration={
markings,
mark=at position 0.5 with {\arrow{latex}}}]
\def\x{2.5}
\def\X{7.6}
\def\y{-1}
\def\Y{1}
\draw[blue] (.5, 0.4*\y)--(18.5, 0.4*\y);
\draw[blue] (.5, 0.4*\Y)--(18.5, 0.4*\Y);
\foreach \x in {1,..., 18} {
%\draw [blue] (\x, 0) node {$\bm\bigodot$};
\pic [scale=.7,blue] at (\x, 0) {fieldout};
}
% Amperiana intermediaria
\draw[color=red,  postaction={decorate}] (\X, \Y)--(\x, \Y) ;
\draw[color=red,  postaction={decorate}] (\x, \y)--(\X, \y);
\draw[red, postaction={decorate}] (\X, \y)--(\X, \Y) node[below right]
{$c$};
\draw[red, postaction={decorate}] (\x, \Y) -- (\x, \y);
\draw[ <->] (\x, 1.3*\Y) -- (\X, 1.3*\Y) node[midway, above] {$\ell$};
\draw[blue]  (10, 0.7) node {$\vec\kappa$};
\draw[red, -latex]  (11, 2.0) -- (10, 2) node [above] {$\vec B$};
\draw[red, -latex]  (10, -2.0) -- (11, -2) node [above] {$-\vec B$};
\draw[red, -latex]  (17, 1.0) --++ (1, 0) node [below] {$x$};
\draw[red, -latex]  (17, 1.0) --++ (0, 1) node [left] {$y$};
%\filldraw[white] (17, 1.0) circle (0.2) node[red] {\small$\bm\bigodot$};
\pic [scale=.7,red] at (17, 1.0) {fieldout};
\draw[red] (17, 1.0) node[left=0.1] {$z$};
\end{tikzpicture}

\end{document}


• Very good answer. Now I have removed my answer and I have upvoted your. – Sebastiano Jul 17 '18 at 21:43
• I think I'm missing out some detail. Maybe, my version of tikz/pgf. Unfortunately, I haven't been able to compile this version of the solution. I get the following compilation error: "Package pgfkeys Error: I do not know the key '/tikz/fieldout/.pic' and I am going to ignore it. Perhaps you misspelled it." – minimax Jul 18 '18 at 13:21
• I think the problem is due to my old version of tikz: tikz.sty 2010/10/13 v2.10 (rcs-revision 1.76) – minimax Jul 18 '18 at 13:52
• I updated my tikz package to: " tikz.sty 2015/08/07 v3.0.1a (rcs-revision 1.151)", and now this solution works! – minimax Jul 19 '18 at 14:04