This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| latex:exampe_eta [2017/07/21 14:13] – iwn | latex:exampe_eta [2022/12/02 15:44] (current) – iwn | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <WRAP group>< | + | <WRAP group>< |
| - | \\ | + | // // |
| - | </ | + | </ |
| - | {{ latex: | + | {{ latex: |
| - | </ | + | </ |
| - | \\ | + | // // |
| + | </ | ||
| + | {{ latex: | ||
| + | </ | ||
| + | // // | ||
| </ | </ | ||
| + | Pseudorapidity. For more, please visit https:// | ||
| - | + | <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, | |
| - | \documentclass{article} | + | |
| - | \usepackage{amsmath} % for \text | + | |
| - | \usepackage{tikz} | + | |
| \tikzset{> | \tikzset{> | ||
| - | \definecolor{mylightred}{RGB}{255, | ||
| - | \definecolor{mylightblue}{RGB}{172, | ||
| - | \definecolor{mylightgreen}{RGB}{150, | ||
| - | |||
| - | % split figures into pages | ||
| - | \usepackage[active, | ||
| - | \PreviewEnvironment{tikzpicture} | ||
| - | \setlength\PreviewBorder{1pt}% | ||
| \begin{document} | \begin{document} | ||
| + | |||
| + | |||
| + | % SIMPLE FOR-LOOP | ||
| \begin{tikzpicture}[scale=3] | \begin{tikzpicture}[scale=3] | ||
| | | ||
| - | % limits | + | % setting |
| - | \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, | + | \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, |
| - | \draw[->, | + | \draw[->, |
| (0,0) -- ({\R*cos(\t)}, | (0,0) -- ({\R*cos(\t)}, | ||
| - | | + | node[anchor=180+\t, |
| - | | + | |
| - | \node[fill=white, | + | |
| } | } | ||
| | | ||
| \end{tikzpicture} | \end{tikzpicture} | ||
| + | |||
| + | |||
| + | % PSEUDORAPIDITY with manual for-loop over theta, eta | ||
| + | \begin{tikzpicture}[scale=3] | ||
| + | | ||
| + | % setting | ||
| + | \def\R{1.2} % radius/ | ||
| + | | ||
| + | % axis labels | ||
| + | \node[scale=1, | ||
| + | \node[scale=1, | ||
| + | | ||
| + | % lines | ||
| + | \foreach \t/\e in {90/ | ||
| + | \pgfkeys{/ | ||
| + | \draw[->, | ||
| + | (0,0) -- (\t:\R) node[anchor=180+\t, | ||
| + | node[black, | ||
| + | } | ||
| + | %\draw[black!60!red, | ||
| + | | ||
| + | \end{tikzpicture} | ||
| + | |||
| + | |||
| + | % PSEUDORAPIDITY with automatic calculation of eta | ||
| + | \begin{tikzpicture}[scale=3] | ||
| + | | ||
| + | % setting | ||
| + | \def\R{1.2} % radius/ | ||
| + | | ||
| + | % axis labels | ||
| + | \node[scale=1, | ||
| + | \node[scale=1, | ||
| + | | ||
| + | % lines | ||
| + | \pgfkeys{/ | ||
| + | \foreach \t in {90, | ||
| + | \ifnum \t = 0 | ||
| + | \def\e{+\infty} % infinity symbol | ||
| + | \else | ||
| + | \pgfmathparse{-ln(tan(\t/ | ||
| + | %\pgfmathroundto{\pgfmathresult} % round without traling zeroes | ||
| + | \pgfmathroundtozerofill{\pgfmathresult} % round with trailing zeroes | ||
| + | \pgfmathsetmacro\e{\t==90? | ||
| + | \fi | ||
| + | \draw[->, | ||
| + | (0,0) -- (\t:\R) node[anchor=180+\t, | ||
| + | node[black, | ||
| + | } | ||
| + | %\draw[black!60!red, | ||
| + | | ||
| + | \end{tikzpicture} | ||
| + | |||
| + | |||
| \end{document} | \end{document} | ||
| </ | </ | ||