This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
latex:example_spherical_coordinates [2017/06/07 20:35] – iwn | latex:example_spherical_coordinates [2021/09/29 12:38] (current) – iwn | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{ latex: | + | <WRAP group>< |
+ | {{ latex: spherical_coordinates.png ? 0x1000 | ||
+ | </ | ||
+ | \\ | ||
+ | {{ latex: | ||
+ | </ | ||
Simple example of 3D axes with spherical coordinates. | Simple example of 3D axes with spherical coordinates. | ||
+ | You can find more diagrams of coordinate systems [[https:// | ||
- | <file latex spherical_coordinates.tex> | + | <file latex axes3D.tex> |
% Author: Izaak Neutelings (June 2017) | % Author: Izaak Neutelings (June 2017) | ||
% taken from https:// | % taken from https:// | ||
Line 19: | Line 25: | ||
\begin{document} | \begin{document} | ||
+ | |||
+ | |||
+ | % 3D axis with spherical coordinates | ||
\tdplotsetmaincoords{60}{110} | \tdplotsetmaincoords{60}{110} | ||
\begin{tikzpicture}[scale=3, | \begin{tikzpicture}[scale=3, | ||
Line 27: | Line 36: | ||
\def\phivec{60} | \def\phivec{60} | ||
| | ||
- | % axes & vector | + | % axes |
\coordinate (O) at (0,0,0); | \coordinate (O) at (0,0,0); | ||
\draw[thick, | \draw[thick, | ||
\draw[thick, | \draw[thick, | ||
\draw[thick, | \draw[thick, | ||
+ | | ||
+ | % vectors | ||
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec} | \tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec} | ||
- | | + | |
+ | \draw[dashed, | ||
+ | \draw[dashed, | ||
+ | \draw[dashed, | ||
| | ||
% arcs | % arcs | ||
- | \draw[dashed, | ||
- | \draw[dashed, | ||
\tdplotdrawarc[-> | \tdplotdrawarc[-> | ||
{anchor=north}{$\phi$} | {anchor=north}{$\phi$} | ||
Line 45: | Line 57: | ||
\end{tikzpicture} | \end{tikzpicture} | ||
+ | |||
+ | |||
+ | |||
+ | % CMS conventional coordinate system with LHC and other detectors | ||
+ | \tdplotsetmaincoords{75}{50} % to reset previous setting | ||
+ | \begin{tikzpicture}[scale=2.7, | ||
+ | | ||
+ | % 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, | ||
+ | \draw[thick, | ||
+ | \draw[thick, | ||
+ | \tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec} | ||
+ | | ||
+ | % vectors | ||
+ | \draw[->, | ||
+ | \draw[dashed, | ||
+ | \draw[dashed, | ||
+ | \draw[dashed, | ||
+ | | ||
+ | % circle - LHC | ||
+ | \tdplotdrawarc[thick, | ||
+ | | ||
+ | % compass - the line between CMS and ATLAS has a ~12° declination (http:// | ||
+ | \begin{scope}[shift={(1.1*\R, | ||
+ | \draw[< | ||
+ | \draw[< | ||
+ | \node[above left, | ||
+ | \end{scope} | ||
+ | |||
+ | % nodes | ||
+ | \node[left, | ||
+ | \node[right] at (\R,0,0) {LHC}; | ||
+ | \fill[radius=0.8pt, | ||
+ | (O) circle node[left=4pt, | ||
+ | \draw[thick] (0.02,0,0) -- (0.5,0,0); % partially overdraw x-axis and CMS point | ||
+ | \fill[radius=0.8pt, | ||
+ | (2*\R,0,0) circle | ||
+ | node[right=4pt, | ||
+ | \fill[radius=0.8pt, | ||
+ | ({\R*sqrt(2)/ | ||
+ | node[left=2pt, | ||
+ | \fill[radius=0.8pt, | ||
+ | ({\R*sqrt(2)/ | ||
+ | node[below=2pt, | ||
+ | | ||
+ | % arcs | ||
+ | \tdplotdrawarc[-> | ||
+ | {above=2pt, | ||
+ | \tdplotdrawarc[->, | ||
+ | {anchor=mid east}{$\theta$} | ||
+ | |||
+ | \end{tikzpicture} | ||
+ | |||
+ | |||
\end{document} | \end{document} | ||
</ | </ |