Summary Files Commits Branches @commit @diff @stats
path: root / src / blog / the-physics-behind-a-black-hole-shader / algorithm.tex
diff options
context:
space:
mode:
Commitd90f2b3be2e7637fa4b1dbb3fad48da3a5266c6a (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-08-20 08:02:36 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-08-20 08:02:36 +0300
Files6707b8e5fef8cfa9d2552620d70d47fa58ca2d7e /src/blog/the-physics-behind-a-black-hole-shader/algorithm.tex
syndamia.com-d90f2b3be2e7637fa4b1dbb3fad48da3a5266c6a.tar
syndamia.com-d90f2b3be2e7637fa4b1dbb3fad48da3a5266c6a.tar.gz
syndamia.com-d90f2b3be2e7637fa4b1dbb3fad48da3a5266c6a.zip
Parent8cbdfa456cbfcadd1364580a90bd26f0dec38743 (diff)
feat(blog/physics-black-hole-shader): Separate LaTeX markup into files
1 files changed, 25 insertions, 0 deletions
-rw-r--r--src/blog/the-physics-behind-a-black-hole-shader/algorithm.tex25
diff --git a/src/blog/the-physics-behind-a-black-hole-shader/algorithm.tex b/src/blog/the-physics-behind-a-black-hole-shader/algorithm.tex
new file mode 100644
index 0000000..3e33a11
--- /dev/null
+++ b/src/blog/the-physics-behind-a-black-hole-shader/algorithm.tex
@@ -0,0 +1,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*}