-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrandom.tex
executable file
·51 lines (46 loc) · 1.14 KB
/
random.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\documentclass[tikz, border = 1 cm]{standalone}
%%%%%%%%%%%%%%
\usepackage{bm}
\usepackage{tikz}
\usetikzlibrary{calc}
%%%%%%%%%%%%%%
%%%%%%%%%%%%%%
\definecolor{blue1} {RGB}{0,177,234}
\definecolor{purple1} {RGB}{89,89,171}
\definecolor{gray2} {RGB}{129,135,141}
%%%%%%%%%%%%%%
%%%%%%%%%%%%%%
%%%%%%%%%%%%%%
%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%
\begin{tikzpicture}
\draw[thick,draw=gray2] (0,0) circle (2cm);
\draw[thick] (0,0) rectangle (2,2);
\newcommand{\points}{
\foreach \x in {1,...,100}{
\pgfmathrandominteger{\r}{3}{55}
\pgfmathrandominteger{\t}{3}{87}
\pgfpathcircle{\pgfpointpolar{\t}{\r}}{0.9pt}
\color{blue1}
\pgfsetstrokecolor{blue1}
\pgfusepath{stroke, fill}
}
\foreach \x in {1,...,100}{
\pgfmathrandominteger{\r}{59}{76}
\pgfmathrandominteger{\t}{2}{88}
\pgfpathcircle{\pgfpointpolar{\t}{\r}}{0.9pt}
\color{purple1}
\pgfsetstrokecolor{purple1}
\pgfusepath{stroke, fill}
}
}
\newcommand{\carre}{(0.02,0.02) rectangle (1.98,1.98)}
\begin{scope}
\clip \carre;
\points;
\end{scope}
\node[thick,scale=0.85] at (1,-0.2) {\textbf{r=1}};
\end{tikzpicture}
%%%%%%%%%%%%%%
\end{document}