-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcbc_binary_tikz.sty
187 lines (152 loc) · 5.42 KB
/
cbc_binary_tikz.sty
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
%% start of file `cbc_binary_tikz.sty'.
%% Copyright 2024 Max Melching ([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
\ProvidesPackage{cbc_binary_tikz}
\RequirePackage{tikz}
\RequirePackage{tikz-3dplot}
\RequirePackage{xcolor}
\usetikzlibrary{
arrows.meta,
math,
calc,
}
\tikzset{>={Stealth[inset=0,angle'=27]}}
\definecolor{persianblue}{rgb}{0.11, 0.22, 0.73}
\definecolor{applegreen}{rgb}{0.55, 0.71, 0.0}
\definecolor{brilliantrose}{rgb}{1.0, 0.33, 0.64}
\definecolor{spincolor}{named}{brown}
\definecolor{lcolor}{named}{persianblue}
\colorlet{jcolor}{spincolor!50!lcolor}
\definecolor{chicolor}{named}{applegreen}
\definecolor{thetacolor}{named}{brilliantrose}
\tdplotsetmaincoords{70}{120} % So that a default is set
\pgfkeys{
/binary/.is family, /binary,
default/.style = {
mass1 = 20,
mass2 = 10,
spin1x = 0,
spin1y = 0,
spin1z = 0,
spin2x = 0,
spin2y = 0,
spin2z = 0,
inclination = 0,
polarization = 0,
eccentricity = 0,
binaryseparation = 6,
showcombinedquantities = true,
},
mass1/.estore in = \massone,
mass2/.estore in = \masstwo,
spin1x/.estore in = \spinonex,
spin1y/.estore in = \spinoney,
spin1z/.estore in = \spinonez,
spin2x/.estore in = \spintwox,
spin2y/.estore in = \spintwoy,
spin2z/.estore in = \spintwoz,
inclination/.estore in = \Inclination,
polarization/.estore in = \Polarization,
eccentricity/.estore in = \eccentricity,
binaryseparation/.estore in = \binaryseparation,
showcombinedquantities/.estore in = \ShowCombinedQuantities,
}
\def\BHsizepersolmass{1/20*0.7 cm} % So that 20 solmass BH has size of 0.7 sm
\def\UnitSpinSize{1.5*\BHsizepersolmass} % To get proportions right
\newcommand{\drawbinary}[1][]{%
% -- Import keys for styling
\pgfkeys{/binary, default, #1}
\begin{scope}[
tdplot_main_coords, % Make sure their default value is used
rotate around z=\Polarization,
rotate around x=\Inclination,
]
% -- Named coordinates are not affected by rotations, does not
% -- matter if we define before or after they are applied
\coordinate (center) at (0, 0, 0);
\coordinate (bh1position) at (\binaryseparation/2, 0, 0);
\coordinate (bh2position) at (-\binaryseparation/2, 0, 0);
\begin{scope}[
scale=\UnitSpinSize, % Trick to resize vectors
]
\coordinate (spin1) at (\spinonex, \spinoney, \spinonez);
\coordinate (spin2) at (\spintwox, \spintwoy, \spintwoz);
\coordinate (totalspin) at ($(spin1) + (spin2)$);
\end{scope}
\coordinate (angularmomentum) at (0, 0, 2*\UnitSpinSize);
\coordinate (totalangularmomentum) at ($(angularmomentum) + (totalspin)$);
\coordinate (chieff) at ($0.5*(angularmomentum)$);
\coordinate (chip) at ($0.5*(bh1position)$);
\begin{scope}[
% rotate around z=\Polarization,
% rotate around x=\Inclination,
canvas is xy plane at z=0,
]
% -- Orbit
\draw[
dashed,
gray,
thick,
opacity=0.5,
yscale=1-\eccentricity,
] (center) circle(0.5*\binaryseparation cm);
% -- Black Hole 1
\node[
fill,
circle,
minimum size={\massone*\BHsizepersolmass},
inner sep=0pt,
label={below:\textcolor{spincolor}{$m_1$}},
] at (bh1position) {};
\draw[
->,
thick,
spincolor,
] (bh1position) -- ++(spin1) node[above]{$\vec{S}_1$};
% -- Black Hole 2
\node[
fill,
circle,
minimum size={\masstwo*\BHsizepersolmass},
inner sep=0pt,
label={below right:\textcolor{spincolor}{$m_2$}},
] at (bh2position) {};
\draw[
->,
thick,
spincolor,
] (bh2position) -- ++(spin2) node[right]{$\vec{S}_2$};
% -- Stuff related to spins and angular momentum
\draw[
->,
thick,
lcolor,
] (center) -- (angularmomentum) node[left]{$\vec{L}_N$};
\ifthenelse{\equal{\ShowCombinedQuantities}{true}}{
\draw[
->,
thick,
spincolor,
] (center) -- ++(totalspin) node[right]{$\vec{S}$};
\draw[
->,
thick,
jcolor,
] (center) -- (totalangularmomentum) node[left]{$\vec{J}$};
\draw[
->,
thick,
chicolor,
] (center) -- ++(chieff) node[below left]{$\chi_\mathrm{eff}$};
\draw[
->,
thick,
chicolor,
] (center) -- ++(chip) node[below]{$\chi_p$};
}{}
\end{scope}
\end{scope}
}