Created
October 12, 2020 14:57
-
-
Save paulgessinger/8d0956a8ea02b9f6884b7b85df5f9426 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[dvipsnames,crop=true]{standalone} | |
\usepackage{tikz,pgfplots} | |
\usetikzlibrary{calc,external,intersections,pgfplots.colormaps} | |
\begin{document} | |
\tikzsetnextfilename{seeding} | |
\begin{tikzpicture}[scale=0.7,line width=1pt] | |
\begin{scope}[/pgfplots/colormap/viridis, | |
cmap/.style={/utils/exec={ | |
\pgfplotscolormapdefinemappedcolor{#1}}, | |
fill=mapped color}] | |
\foreach \r [count=\i] in {1, 2, 3, 4} { | |
\draw[name path global/.expanded=r\i] (0,0) circle(\r); | |
} | |
\pgfmathsetseed{1042} | |
\def\n{6} | |
\foreach \i in {1,...,\n} { | |
\pgfmathsetmacro{\a}{360/\n * \i} | |
\pgfmathsetmacro{\b}{rand*30} | |
\pgfmathsetmacro{\bo}{\b} | |
\pgfmathsetmacro{\bi}{180-\b} | |
\begin{scope}[rotate=\a] | |
\draw[->,name path global/.expanded=t\i,dashed] (0,0) to[out={\bo},in={\bi}] (5,0); | |
\end{scope} | |
\pgfmathsetmacro{\bmid}{\b/2} | |
\pgfmathsetmacro{\col}{int(1000/\n * \i + 100)} | |
\foreach \r in {1, 2, 3, 4} { | |
\path[name intersections={of={t\i} and {r\r},by={h\r}}]; | |
\fill[cmap=\col] (h\r) circle(4pt); | |
% \fill[LimeGreen] (h\r) circle(2pt); | |
} | |
\pgfmathsetmacro{\hof}{int(rand+1)} | |
\pgfmathsetmacro{\hi}{int(1+\hof)} | |
\pgfmathsetmacro{\hm}{int(2+\hof)} | |
\pgfmathsetmacro{\ho}{int(3+\hof)} | |
\coordinate (sd) at ($(h\ho) - (h\hi)$); | |
\path let \p1=(sd), \n1={atan2(\y1, \x1)}, \n2={\y1*5cm} in node[Orange,rounded corners,draw,rotate=\n1,inner sep=0,minimum height=3mm,minimum width=2.1cm,rectangle] at (h\hm) {}; | |
} | |
\end{scope} | |
\end{tikzpicture} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment