User Tools

Site Tools


latex:exampe_eta

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
latex:exampe_eta [2017/07/21 14:13] iwnlatex:exampe_eta [2022/12/02 15:43] iwn
Line 1: Line 1:
-<WRAP group><WRAP third column 20%> +<WRAP group><WRAP column 2%> 
-\\ + // // 
-</WRAP><WRAP third column 50%> +</WRAP><WRAP column 40%> 
-{{ latex: theta_eta.png ? 0x1000 }} +{{ latex: theta.png ? 0x1000 }} 
-</WRAP><WRAP third column 20%> +</WRAP><WRAP column 2%> 
-\\+ // // 
 +</WRAP><WRAP column 42%> 
 +{{ latex:tikz:axis2d_pseudorapidity.png ? 0x1000 }} 
 +</WRAP><WRAP column 2%> 
 + // //
 </WRAP></WRAP> </WRAP></WRAP>
  
 +Pseudorapidity. For more, please visit https://tikz.net/category/physics/particle-physics/.
  
- +<file latex theta-eta.tex> 
-<file latex axes3D.tex> +% Author: Izaak Neutelings (June 2017) 
-% Author: Izaak Neutelings (July 2017) +% Updated: December 2022 
- +\documentclass[border=3pt,tikz]{standalone}
-\documentclass{article} +
-\usepackage{amsmath} % for \text +
-\usepackage{tikz}+
 \tikzset{>=latex} % for LaTeX arrow head \tikzset{>=latex} % for LaTeX arrow head
-\definecolor{mylightred}{RGB}{255,200,200} 
-\definecolor{mylightblue}{RGB}{172,188,63} 
-\definecolor{mylightgreen}{RGB}{150,220,150} 
- 
-% split figures into pages 
-\usepackage[active,tightpage]{preview} 
-\PreviewEnvironment{tikzpicture} 
-\setlength\PreviewBorder{1pt}% 
  
 \begin{document} \begin{document}
 +
 +
 +% SIMPLE FOR-LOOP
 \begin{tikzpicture}[scale=3] \begin{tikzpicture}[scale=3]
      
   % limits   % limits
-  \def\N{4} 
   \def\R{1.2}   \def\R{1.2}
      
   % axis labels   % axis labels
-  \node[scale=0.8,below left=1pt] at (0,\R) {$y$}; +  \node[below=5pt,left=2pt] at (0,\R) {$y$}; 
-  \node[scale=0.8,below left=1pt] at (\R,0) {$z$};+  \node[left=5pt,below=2pt] at (\R,0) {$z$};
      
   % lines   % lines
-  \foreach \t/\e in {90/0,60/0.55,45/0.88,30/1.32,10/2.44,0/\infty}{ +  \foreach \t in {90,60,45,30,10,0}{ 
-    \draw[->,black!60!red,thick] %samples=\N,variable=\x,domain=0:1]+    \draw[->,black!60!red,thick]
       (0,0) -- ({\R*cos(\t)},{\R*sin(\t)})       (0,0) -- ({\R*cos(\t)},{\R*sin(\t)})
-      %plot({\x*\R*cos(\t)},{\x*\R*sin(\t)}) % alternative way with plotting a linear function +      node[anchor=180+\t,black] {$\theta=\t$};
-      node[anchor=180+\t,black] {$\eta=\e$}; +
-    \node[fill=white,scale=0.8] at ({0.8*cos(\t)},{0.8*sin(\t)}) {$\theta=\t^\circ$};+
   }   }
          
 \end{tikzpicture} \end{tikzpicture}
 +
 +
 +% PSEUDORAPIDITY with manual for-loop over theta, eta
 +\begin{tikzpicture}[scale=3]
 +  \def\R{1.2} % radius/length of lines
 +  \node[scale=1,below left=1] at (0,\R) {$y$}; % y axis
 +  \node[scale=1,below left=1] at (\R,0) {$z$}; % z axis
 +  \foreach \t/\e in {90/0,60/0.55,45/0.88,30/1.32,10/2.43,0/+\infty}{ % loop over theta/eta
 +    \pgfkeys{/pgf/number format/precision=2}
 +    \draw[->,black!60!red,thick,line cap=round] % eta lines
 +      (0,0) -- (\t:\R) node[anchor=180+\t,black] {$\eta=\e$}
 +      node[black,pos=0.7,fill=white,scale=0.8,inner sep=1.5pt] {$\theta=\t^\circ$};
 +  }
 +  %\draw[black!60!red,thick] (0,0.1*\R) |- (0.1*\R,0) ; % overlap in corner
 +\end{tikzpicture}
 +
 +
 +% PSEUDORAPIDITY with automatic calculation of eta
 +\begin{tikzpicture}[scale=3]
 +  \pgfkeys{/pgf/number format/precision=2} % two decimals
 +  \def\R{1.2} % radius/length of lines
 +  \node[scale=1,below left=1] at (0,\R) {$y$}; % y axis
 +  \node[scale=1,below left=1] at (\R,0) {$z$}; % z axis
 +  \foreach \t in {90,60,45,30,10,0}{ % loop over theta
 +    \ifnum \t = 0
 +      \def\e{+\infty} % infinity symbol
 +    \else
 +      \pgfmathparse{-ln(tan(\t/2))} % pseudorapidity
 +      %\pgfmathroundto{\pgfmathresult} % round without traling zeroes
 +      \pgfmathroundtozerofill{\pgfmathresult} % round with trailing zeroes
 +      \pgfmathsetmacro\e{\t==90?0:\pgfmathresult} % no trailing zeroes for theta = 0
 +    \fi
 +    \draw[->,black!60!red,thick,line cap=round] % eta lines
 +      (0,0) -- (\t:\R) node[anchor=180+\t,black] {$\eta=\e$}
 +      node[black,pos=0.7,fill=white,scale=0.8,inner sep=1.5pt] {$\theta=\t^\circ$};
 +  }
 +  %\draw[black!60!red,thick] (0,0.1*\R) |- (0.1*\R,0) ; % overlap in corner
 +\end{tikzpicture}
 +
 +
 \end{document} \end{document}
 </file> </file>
latex/exampe_eta.txt · Last modified: 2022/12/02 15:44 by iwn