Summary Files Commits Branches @commit @diff @stats
path: root / src / blog / the-physics-behind-a-black-hole-shader / algorithm.tex
blob: 3e33a11145fe6c259c7cd6c33bd9270298283f0d (plain) (blame)
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
\begin{align*}
    & p_{cbh} = \text{position of center of black hole}\\
    & r_s = \text{Schwarzchild distance from } p_{cbn} \\
    & r_{ps} = \frac{2}{3}r_s \quad \text{(photon sphere)}\\
    & r_{ISCO} = 3 r_s \\
    \\
    & p_l = \text{position of light "particle"}\\
    & v_l = \text{velocity of light "particle"}\\
    \\
    & r_l = \| p_l-p_{cbh} \| \quad \text{(distance between black hole and light)}\\
    & \text{If } r_l \leq r_{ISCO} : \\
    & \quad h = \| r_l \cross v_l \|\\
    & \quad \text{LightMovesLimit} = \infty \\
    & \quad \text{Repeat maximum LightMovesLimit times}:\\
    & \qquad \text{If } r_l \leq r_s : \\
    & \qquad \quad \text{return "Light never escapes"} \\
    & \qquad \text{If } r_l \leq r_{ps} : \\
    & \qquad \quad \text{LightMovesLimit} = 100 \\
    & \qquad \text{If } r_l > r_{ISCO} : \\
    & \qquad \quad \text{return "Light escaped black hole"} \\
    & \qquad p_l = p_l + v_l \quad \text{(move light)}\\
    & \qquad r_l = \| p_l-p_{cbh} \| \quad \text{(update distance to $p_{cbh}$)}\\
    & \qquad v_l = v_l + \overrightarrow{F}(r_l,h) \quad \text{(update light velocity)} \\
    & \quad \text{return "Light stuck in photon sphere, never escapes"}
\end{align*}