-
Notifications
You must be signed in to change notification settings - Fork 3
/
plot-spherical_coords+physics+3d.tex
111 lines (87 loc) · 3.29 KB
/
plot-spherical_coords+physics+3d.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
% https://wiki.physik.uzh.ch/cms/latex:example_spherical_coordinates
% Author: Izaak Neutelings (June 2017)
% taken from https://tex.stackexchange.com/questions/159445/draw-in-cylindrical-and-spherical-coordinates
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\tikzset{>=latex} % for LaTeX arrow head
%% split figures into pages
%\usepackage[active,tightpage]{preview}
%\PreviewEnvironment{tikzpicture}
%\setlength\PreviewBorder{1pt}%
\begin{document}
% 3D axis with spherical coordinates
\tdplotsetmaincoords{60}{110}
\begin{tikzpicture}[scale=3,tdplot_main_coords]
% variables
\def\rvec{.8}
\def\thetavec{30}
\def\phivec{60}
% axes
\coordinate (O) at (0,0,0);
\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};
% vectors
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}
\draw[-stealth,red] (O) -- (P) node[above right] {$P$};
\draw[dashed,red] (O) -- (Pxy);
\draw[dashed,red] (P) -- (Pxy);
\draw[dashed,red] (Py) -- (Pxy);
% arcs
\tdplotdrawarc[->]{(O)}{0.2}{0}{\phivec}
{anchor=north}{$\phi$}
\tdplotsetthetaplanecoords{\phivec}
\tdplotdrawarc[->,tdplot_rotated_coords]{(0,0,0)}{0.5}{0}{\thetavec}
{anchor=south west}{$\theta$}
\end{tikzpicture}
% CMS conventional coordinate system with LHC and other detectors
\tdplotsetmaincoords{75}{50} % to reset previous setting
\begin{tikzpicture}[scale=2.7,tdplot_main_coords,rotate around x=90]
% variables
\def\rvec{1.2}
\def\thetavec{40}
\def\phivec{70}
\def\R{1.1}
\def\w{0.3}
% axes
\coordinate (O) at (0,0,0);
\draw[thick,->] (0,0,0) -- (1,0,0) node[below left]{$x$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[below right]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[below right]{$z$};
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}
% vectors
\draw[->,red] (O) -- (P) node[above left] {$P$};
\draw[dashed,red] (O) -- (Pxy);
\draw[dashed,red] (P) -- (Pxy);
\draw[dashed,red] (Py) -- (Pxy);
% circle - LHC
\tdplotdrawarc[thick,rotate around x=90,black!70!blue]{(\R,0,0)}{\R}{0}{360}{}{}
% compass - the line between CMS and ATLAS has a ~12° declination (http://googlecompass.com)
\begin{scope}[shift={(1.1*\R,0,1.65*\R)},rotate around y=12]
\draw[<->,black!50] (-\w,0,0) -- (\w,0,0);
\draw[<->,black!50] (0,0,-\w) -- (0,0,\w);
\node[above left,black!50,scale=0.6] at (-\w,0,0) {N};
\end{scope}
% nodes
\node[left,align=center] at (0,0,1.1) {Jura};
\node[right] at (\R,0,0) {LHC};
\fill[radius=0.8pt,black!20!red]
(O) circle node[left=4pt,below=2pt] {CMS};
\draw[thick] (0.02,0,0) -- (0.5,0,0); % partially overdraw x-axis and CMS point
\fill[radius=0.8pt,black!20!blue]
(2*\R,0,0) circle
node[right=4pt,below=2pt,scale=0.9] {ATLAS};
\fill[radius=0.8pt,black!10!orange]
({\R*sqrt(2)/2+\R},0,{ \R*sqrt(2)/2}) circle
node[left=2pt,below=2pt,scale=0.8] {ALICE};
\fill[radius=0.8pt,black!60!green]
({\R*sqrt(2)/2+\R},0,{-\R*sqrt(2)/2}) circle
node[below=2pt,right=2pt,scale=0.8] {LHCb};
% arcs
\tdplotdrawarc[->]{(O)}{0.2}{0}{\phivec}
{above=2pt,right=-1pt,anchor=mid west}{$\phi$}
\tdplotdrawarc[->,rotate around z=\phivec-90,rotate around y=-90]{(0,0,0)}{0.5}{0}{\thetavec}
{anchor=mid east}{$\theta$}
\end{tikzpicture}
\end{document}