diff options
1 files changed, 11 insertions, 21 deletions
| -rw-r--r-- | src/blog/the-physics-behind-a-black-hole-shader/index.du | 32 |
diff --git a/src/blog/the-physics-behind-a-black-hole-shader/index.du b/src/blog/the-physics-behind-a-black-hole-shader/index.du index fdb6589..ee42654 100644 --- a/src/blog/the-physics-behind-a-black-hole-shader/index.du +++ b/src/blog/the-physics-behind-a-black-hole-shader/index.du @@ -82,7 +82,7 @@ However, what if our surface isn't flat? Imagine two points on a sphere, what is the shortest distance between them? Obviously, it's an arc of a circle and extending it to it's maximum possible length, we get a {url great circle;https://en.wikipedia.org/wiki/Great_circle}. -{img ./img/Illustration_of_great-circle_distance.svg.png}<br/> +{img ./img/Illustration_of_great-circle_distance.svg.png}{br} {i Image by CheCheDaWaff on {url Wikipedia;https://commons.wikimedia.org/w/index.php?curid=48187293}} Now, what does it mean to go "forwards"? @@ -126,7 +126,7 @@ Schwarzschild's metric and accompanying black hole properties are the simplest p Let's imagine atoms as a set of glass marbles, scattered on a table: -{img https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Marbles_from_Indonesia.jpg/1280px-Marbles_from_Indonesia.jpg}<br/> +{img https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Marbles_from_Indonesia.jpg/1280px-Marbles_from_Indonesia.jpg}{br} {i Image from By Okkisafire on {url Wikipedia;https://commons.wikimedia.org/w/index.php?curid=30338734}} Now, start pushing from all sides of the table to it's center. @@ -156,15 +156,15 @@ In our case, the only important part is it's effect on gravity, and more precise Since a black hole is a single infinitely small point, then all of it's mass is concentrated on that point, making it alter the geodesics in a relatively small area of space {b a lot}. So much so, if you get too close, you will not be able to overwhelm gravity and "merge" into that infinitesimal point: -{img https://upload.wikimedia.org/wikipedia/commons/9/91/CNX_UPhysics_13_07_spacetime.png?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original}<br/> -{i The white lines are our geodesics}<br/> +{img https://upload.wikimedia.org/wikipedia/commons/9/91/CNX_UPhysics_13_07_spacetime.png?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original}{br} +{i The white lines are our geodesics}{br} {i Image by OpenStax University Physics on {url Wikipedia;https://commons.wikimedia.org/w/index.php?curid=64307901}} A fascinating realization is that light always travels along geodesics ("forwards"), therefore this extreme bending allows us to view otherwise obstructed objects. We call that effect {url gravitational lensing;https://en.wikipedia.org/wiki/Gravitational_lens}. Though not unique to black holes, that's when the effect is strongest: -{img https://upload.wikimedia.org/wikipedia/commons/0/02/Gravitational_lens-full.jpg}<br/> +{img https://upload.wikimedia.org/wikipedia/commons/0/02/Gravitational_lens-full.jpg}{br} {i Notice how the gray arrows show the path light travels from a galaxy that is behind (obstructed by) the black hole} I'll abstain from explaining the specifics of light, but you may think of it as a small particle, "similar" to an electron, travelling through space. @@ -189,7 +189,7 @@ Let's get down to business, our starting point, the {url Schwarzschild metric;ht {b YOUCH!} -The variables themselves aren't that bad: {` c} is the speed of light, <code>τ</code> is time, <code>Ω</code>, {` t} and {` r} are Schwarzschild coordinates. +The variables themselves aren't that bad: {` c} is the speed of light, {` &tau\;} is time, {` &Omega\;}, {` t} and {` r} are Schwarzschild coordinates. However, as you can see, there are two big problems: we have to calculate derivatives (that's what the {` d} signifies) and convert from Schwarzschild coordinates to normal (euclidean) coordinates, that the computer understands "natively". This would be {b too slow} to render in real time. @@ -232,53 +232,43 @@ Although the function takes in only one argument, {` r}, that doesn't mean that - {` h} is the magnitude of the {url "specific angular momentum";https://en.wikipedia.org/wiki/Specific_angular_momentum} of the light "particle". - .p "Normal" linear momentum specifies how much "force" at what speed it takes to stop (or change) the speed and direction of an object in linear motion (that's why it's in kg\*m/s). Imagine a big heavy train on a perfectly straight rails going at a fast speed. How do you forcefully stop it? - .p You can put a {i really} heavy barrier on the tracks, in front of the train. Since the train is moving at a really great speed, this barrier will have to be much much heavier (with much more mass) than the train itself. - .p Alternatively, you can "launch" something against the train, meaning you can put a second train, moving in the opposite direction of the first train, so they hit head-on. Since the second train would also be moving, if it's travelling at the same speed and has the same mass as the first train, upon collision they would both stop{fn Of course, I'm assuming the trains are strong enough they won't break upon the collision.}. If the second travels at twice the speed, then it can have half of the mass of the first to produce the same effect. - .p The property with which we can "prove" why both a larger mass at no speed, and a smaller mass at a faster speed, can stop the train, is the momentum. - .p Angular momentum specifies how much "force" at what speed it takes to stop (or change) the speed and direction of a rotating object. Imagine the train scenario but on a circular track. - .p The specific angular momentum is the angular momentum of an object, divided by it's mass. It's magnitude kind of tells us which property is more prevalent in the momentum, the mass or the speed. For the same angular momentum, a long (big magnitude) {i specific} angular momentum means our object is small and moves fast, while for a short (small magnitude) {i specific} angular momentum out object is large and moves slowly. - .p Another simplification we need to is {b make our black hole stationary}! Then, rather than finding the angular momentum{fn Angular momentum is actually {url defined using the cross product;https://en.wikipedia.org/wiki/Specific_angular_momentum#Definition}} and dividing by the mass{fn As mentioned, light has no mass, so this version of the formula wouldn't work.}, we'll use another formula: - .p {img ./img/specific-angular-momentum-wikipedia.png} + {img ./img/specific-angular-momentum-wikipedia.png} - .p where {b in this specific formula only} {` r} is the vector from the singularity to the corpuscle and {` v} is light's velocity. - .p The cross product returns a vector, so we'll need to take the magnitude of the result and plug that into the formula. It's also important that {b we calculate it only once, in the beginning}. So, we shouldn't be calculating the magnitude of the specific angular momentum every time the light "particle" is moved, rather we calculate it once, after it gets close enough to be affected by the black hole. - .p You might think that makes no sense, since we cannot divide by zero, so the specific angular momentum shouldn't exist, but then with the cross product we find a value for it. You would be correct: Antonelli does some funky approximations, combining Newtonian physics with General theory of relativity, to make the formula that simple. - {` r{^ ^}} is the normalized ({url unit;https://en.wikipedia.org/wiki/Unit_vector}, hence the {` ^} on top) vector from the center of the black hole to the light particle: - .p {img ./img/normalize-vector-wikipedia.png} + {img ./img/normalize-vector-wikipedia.png} Finally, putting all needed variables together in one proper function, we get: @@ -324,7 +314,7 @@ Formula: {img ./img/isco-wikipedia.png} Putting them all together, we should expect light to travel like this: -{img https://upload.wikimedia.org/wikipedia/commons/2/27/Black_Hole_Shadow.gif} +{img https://upload.wikimedia.org/wikipedia/commons/2/27/Black_Hole_Shadow.gif}{br} {i Animation by Hugo Spinelli on {url Wikipedia;https://commons.wikimedia.org/w/index.php?curid=138168679}} ## Light-bending algorithm @@ -349,11 +339,11 @@ An algorithm doing this would look a bit like this (in pseudocode, inspired by P {img Refer to "Algorithm" section of the Appendix;./img/algorithm.png} -as a reminder, here is the definition of {` F{^ →}}: +as a reminder, here is the definition of {` F{^ &rarr\;}}: {img ./img/antonelli-formula-expanded.png} -<br/> +{br} That's it! We have all of our theoretical background, formulae and algorithm to start work on our actual program. |