This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| latex:exampe_eta [2017/09/11 15:45] – iwn | latex:exampe_eta [2022/12/02 15:44] (current) – iwn | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| // // | // // | ||
| </ | </ | ||
| - | {{ latex: | + | {{ latex:tikz: |
| </ | </ | ||
| // // | // // | ||
| </ | </ | ||
| + | Pseudorapidity. For more, please visit https:// | ||
| - | + | <file latex theta-eta.tex> | |
| - | <file latex eta-theta.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 | ||
| Line 53: | Line 42: | ||
| + | % PSEUDORAPIDITY with manual for-loop over theta, eta | ||
| \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[scale=1,below left=1] at (0,\R) {$y$}; |
| - | \node[scale=0.8,below left=1pt] at (\R,0) {$z$}; | + | \node[scale=1,below left=1] at (\R,0) {$z$}; |
| | | ||
| % lines | % lines | ||
| - | \foreach \t/\e in {90/ | + | \foreach \t/\e in {90/ |
| - | \draw[->, | + | \pgfkeys{/ |
| - | (0,0) -- ({\R*cos(\t)},{\R*sin(\t)}) | + | \draw[->, |
| - | %plot({\x*\R*cos(\t)}, | + | (0,0) -- (\t:\R) node[anchor=180+\t, |
| - | | + | node[black, |
| - | \node[fill=white, | + | |
| } | } | ||
| - | | + | %\draw[black!60!red, |
| + | | ||
| \end{tikzpicture} | \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} | ||
| </ | </ | ||