-
Notifications
You must be signed in to change notification settings - Fork 0
/
mirror-nuclei.tex
65 lines (61 loc) · 3.86 KB
/
mirror-nuclei.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
\documentclass[tikz]{standalone}
\usetikzlibrary{calc} %compute position of coordinates
\usepackage{tikz-3dplot} %3d features
\pgfmathsetmacro\THETA{80} %defines angle of view
\pgfmathsetmacro\PHI{140} %defines angle of view
\pgfmathsetmacro\SHIFT{0.25} %distance between nucleus and mirror
\pgfmathsetmacro\SIZE{1.75} %size of mirror
\pgfmathsetmacro\SIZESHIFT{sin(45)*0.5*\SIZE} %used for positioning the mirror
\pgfmathsetmacro\SIZESCALE{0.5*\SIZE} %scales the mirror
\directlua{math.randomseed(4)} %choose pseudorandom number generator seed
\newcommand\x{\directlua{tex.sprint(math.random()*0.1+0.015)}} %random heights for inner breaking
\newcommand\randangle{\directlua{tex.sprint(0.1*math.random(100)-5)}} %random changes in angles
\begin{document}
\tdplotsetmaincoords{\THETA}{\PHI}
\begin{tikzpicture}[tdplot_main_coords]
\tdplotsetrotatedcoords{\PHI-90}{\THETA}{90}
\coordinate (Shift) at ($(-\SHIFT,0,0)+sin(45)*\SIZE*0.5*(0,1,1)+(0,0,-0.09)$);
\tdplotsetrotatedcoordsorigin{(Shift)}
\colorlet{neutron}{blue}
\colorlet{proton}{red}
\fill [ball color=proton,very thin,tdplot_rotated_coords] (-0.075,0.025,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0,0,0) circle (0.05);
\fill [ball color=proton,very thin,tdplot_rotated_coords] (0.075,0.025,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (-0.1,0.1,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0.015,0.185,0) circle (0.05);
\fill [ball color=proton,very thin,tdplot_rotated_coords] (-0.05,0.15,0) circle (0.05);
\fill [ball color=proton,very thin,tdplot_rotated_coords] (0.075,0.15,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0.025,0.13,0) circle (0.05);
\fill [ball color=proton,very thin,tdplot_rotated_coords] (-0.05,0.075,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0.1,0.075,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0.025,0.065,0) circle (0.05);
\tdplotsetrotatedcoords{0}{90}{90}
\coordinate (NewOrigin) at (0,\SIZESHIFT,\SIZESHIFT);
\tdplotsetrotatedcoordsorigin{(NewOrigin)}
\begin{scope}[scale=\SIZESCALE, tdplot_rotated_coords]
\clip (45:1) -- (135:1) -- (225:1) -- (315:1) -- cycle;
\fill[gray!75!cyan, opacity=0.2, even odd rule] (45:1) -- (135:1) -- (225:1) -- (315:1) -- cycle
(0+\randangle:\x) coordinate (A0) foreach \angle in {20,40,...,340} {-- (\angle+\randangle:\x) coordinate (A\angle)} -- cycle% comment this line to fix the mirror
;
\foreach \angle in {0, 20, ..., 340}{% comment this line to fix the mirror
\draw[ultra thin, white] (0,0) -- ($67*(A\angle)$);% comment this line to fix the mirror
};% comment this line to fix the mirror
\end{scope}
\tdplotsetrotatedcoords{\PHI-90}{\THETA}{90}
\coordinate (Shift) at ($(\SHIFT,0,0)+sin(45)*\SIZE*0.5*(0,1,1)+(0,0,-0.09)$);
\tdplotsetrotatedcoordsorigin{(Shift)}
\colorlet{neutron}{red}
\colorlet{proton}{blue}
\fill [ball color=proton,very thin,tdplot_rotated_coords] (-0.075,0.025,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0,0,0) circle (0.05);
\fill [ball color=proton,very thin,tdplot_rotated_coords] (0.075,0.025,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (-0.1,0.1,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0.015,0.185,0) circle (0.05);
\fill [ball color=proton,very thin,tdplot_rotated_coords] (-0.05,0.15,0) circle (0.05);
\fill [ball color=proton,very thin,tdplot_rotated_coords] (0.075,0.15,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0.025,0.13,0) circle (0.05);
\fill [ball color=proton,very thin,tdplot_rotated_coords] (-0.05,0.075,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0.1,0.075,0) circle (0.05);
\fill [ball color=neutron,very thin,tdplot_rotated_coords] (0.025,0.065,0) circle (0.05);
\end{tikzpicture}
\end{document}