I am trying to make a drawing using tikz
. In this drawing, I put some shapes in specific angles. What I want to do is "highlight" those angles using simple dashed lines. My code is the following
\documentclass{article}
\usepackage{kerkis}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% Incident Beam
\draw[->, very thick] (-5,0) -- (2,0);
% Target : Boron + Au
\shade[top color=gray!60, bottom color=gray!20] (6,1) rectangle (6.25,-1);% Au
\shade[top color=gray!80, bottom color=gray!40] (6.25,1) rectangle (7.25,-1);% B
% Scattering Chamber
%\draw[dotted, red, very thick] (6.6125,0) circle (8cm);
%\draw[dotted, red, very thick] (6.6125,0) circle (9cm);
% Telescopes
\path(6.6125,0)+(170:8)node[right color=black!70, left color=black!20,minimum width=1.2cm,minimum height=.4cm,rotate=80]{$\Delta E$};
\path(6.6125,0)+(-120:8)node[top color=black!70, bottom color=black!20,minimum width=1.2cm,minimum height=.4cm, rotate=-210]{$\Delta E$};
\path(6.6125,0)+(170:9)node[right color=black!80, left color=black!40,minimum width=1.2cm,minimum height=1.4cm,rotate=80]{$\mathbf{E}$};
\path(6.6125,0)+(-120:9)node[top color=black!80, bottom color=black!40,minimum width=1.2cm,minimum height=1.4cm, rotate=-210]{$\mathbf{E}$};
% Angles
\draw[dashed, gray, thick] (4,0) -- (6,0);
\draw[dashed, gray, thick,->] (6,0) -- (170:2);% <-------- This is where it's not working as expected
\end{tikzpicture}
\end{document}
The output of the above code is
You can see that I am creating a horizontal line \draw[dashed, gray, thick] (4,0) -- (6,0);
. I want to create other lines that will point to the grouped rectangles(which are placed in specific angles) so I used \draw[dashed, gray, thick,->] (6,0) -- (170:2);
in order to point to the right angle and have the same length as the horizontal line, but it seems that there is something weird going on when using polar coordinates...
Any idea on why is this happening and how to achieve the desired drawing?
EDIT I also tried(after suggestion's) to use \draw[dashed, gray, thick,->] (6,0) -- +(170:2);
but the lines aren't perfectly centered with the rectangles, as shown below
The code for the above image is the following
\documentclass{article}
\usepackage{kerkis}
\include{tikz}
\begin{document}
\begin{tikzpicture}
% Incident Beam
\draw[->, very thick] (-5,0) -- (2,0);
\node[above] at (-4.5,0) (proton) {$p^+$};
% Target : Boron + Au
\shade[top color=gray!60, bottom color=gray!20] (6,1) rectangle (6.25,-1);% Au
\node[left] at (6.1,1.2) (Au) {$Au$};
\shade[top color=gray!80, bottom color=gray!40] (6.25,1) rectangle (7.25,-1);% B
\node[right] at (6.75,1.2) (B) {$^{nat}B$};
% Telescopes
\path(6.6125,0)+(170:8)node[right color=black!70, left color=black!20,minimum width=1.2cm,minimum height=.4cm,rotate=80]{$\Delta E$};
\path(6.6125,0)+(170:8)node[above=0.75cm, right=0cm]{$6\mu m$};
\path(6.6125,0)+(-120:8)node[top color=black!70, bottom color=black!20,minimum width=1.2cm,minimum height=.4cm, rotate=-210]{$\Delta E$};
\path(6.6125,0)+(-120:8)node[below=0.35cm,right=0.5cm]{$22\mu m$};
\path(6.6125,0)+(170:9)node[right color=black!80, left color=black!40,minimum width=1.2cm,minimum height=1.4cm,rotate=80]{$\mathbf{E}$};
\path(6.6125,0)+(170:9)node[above=0.9cm, left=0cm]{$1000\mu m$};
\path(6.6125,0)+(-120:9)node[top color=black!80, bottom color=black!40,minimum width=1.2cm,minimum height=1.4cm, rotate=-210]{$\mathbf{E}$};
\path(6.6125,0)+(-120:9)node[below=0.35cm,right=0.5cm]{$1000\mu m$};
% Angles
\draw[dashed, gray, thick] (2,0) -- (6,0);
\draw[dashed, gray, thick] (6,0) -- +(170:7.5);
\draw[dashed, gray, thick] (6,0) -- +(-120:7.5);
%
\end{tikzpicture}
\end{document}
($(6,0)!2cm!(delta1)$)
?\draw[dashed, gray, thick,->] (6,0) -- (170:2);
---> Draws a line from point(6,0)
to point(170:2)
, where 170 is the polar angle and 2 is the polar radius.\draw[dashed, gray, thick] (4,0) -- (6,0);
This is a line with length 2. Those two line don't have the same length...Why? Also \path(6.6125,0)+(170:8)node[]{};` draws a rectangle at 170 degrees. Why the line doesn't point at the center of this rectangle?\draw[dashed, gray, thick,->] (6,0) -- +(170:2);
6
instead of6.6125
.