This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
latex:exampe_eta [2022/12/02 15:42] – iwn | latex:exampe_eta [2022/12/02 15:43] – iwn | ||
---|---|---|---|
Line 14: | Line 14: | ||
<file latex theta-eta.tex> | <file latex theta-eta.tex> | ||
- | % Author: Izaak Neutelings (July 2017) | + | % Author: Izaak Neutelings (June 2017) |
- | + | % Updated: December 2022 | |
- | \documentclass{article} | + | \documentclass[border=3pt, |
- | \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] | ||
| | ||
Line 52: | Line 42: | ||
+ | % PSEUDORAPIDITY with manual for-loop over theta, eta | ||
+ | \begin{tikzpicture}[scale=3] | ||
+ | \def\R{1.2} % radius/ | ||
+ | \node[scale=1, | ||
+ | \node[scale=1, | ||
+ | \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] | \begin{tikzpicture}[scale=3] | ||
- | | + | \pgfkeys{/pgf/number format/ |
- | % limits | + | \def\R{1.2} % radius/ |
- | %\def\N{4} | + | \node[scale=1,below left=1] at (0,\R) {$y$}; |
- | \def\R{1.2} | + | \node[scale=1,below left=1] at (\R,0) {$z$}; % z axis |
- | + | \foreach \t in {90, | |
- | | + | \ifnum \t = 0 |
- | \node[scale=0.9,below=5pt,left=2pt] at (0,\R) {$y$}; | + | \def\e{+\infty} |
- | \node[scale=0.9,left=5pt, | + | \else |
- | + | \pgfmathparse{-ln(tan(\t/ | |
- | | + | %\pgfmathroundto{\pgfmathresult} % round without traling zeroes |
- | \foreach \t/\e in {90/0,60/0.55,45/0.88,30/1.32,10/2.44,0/\infty}{ | + | \pgfmathroundtozerofill{\pgfmathresult} % round with trailing zeroes |
- | \draw[->, | + | \pgfmathsetmacro\e{\t==90? |
- | (0,0) -- ({\R*cos(\t)},{\R*sin(\t)}) | + | \fi |
- | %plot({\x*\R*cos(\t)}, | + | \draw[->, |
- | | + | (0,0) -- (\t:\R) node[anchor=180+\t, |
- | \node[fill=white, | + | node[black, |
} | } | ||
- | | + | %\draw[black!60!red, |
\end{tikzpicture} | \end{tikzpicture} | ||
- | |||
\end{document} | \end{document} | ||
</ | </ |