Monthly Archive: June 2015

Thoughts about light bending

I had a sudden moment of clarity recently when thinking about how to remove a graphical artifact from the Black Hole Simulator.

The problem

artifact

The current simulator has one ugly aspect of the rendered image. Exactly 90 degrees from the direction to the black hole a graphical artifact appears - a strip of smudged, incorrectly calculated pixels (see the picture to the right). The reason is hidden deeply in the rendering mechanism.

In short, it looks like this - you can't efficiently calculate the color of every pixel by raytracing. Taking advantage of the symmetry of the Schwarzschild black hole, I created a table of angles of light deflection. Thanks to the symmetry, I can describe each ray of light by only one parameter - simply put, the minimal distance from the black hole along its path (actually, the impact parameter). To calculate the deflection, I need one more thing, and that is the distance from the black hole at which I send/receive it - the greater part of the whole path the ray has to travel, the greater the deflection.

Such a table was being sent to the graphics card. Then, during rendering, a direction of the ray was calculated for each pixel, and this was converted into the impact parameter. The distance was known independently. Appropriate deflection was being read from the table and this was used to calculate the color of the pixel.

In theory everything is fine, but one problem appeared - the light rays sent in directions close to 90 degrees from the black hole have very similar impact parameters. This gives nearly identical deflection angles, which makes many pixels the same color. An ugly strip appears.

(more…)

A new article and a program

I finally translated some new things into English.

One of them is the first part of the series about relativity - this time I described the concept of a metric and its uses. You can read it here.

The second one is a small program, letting you distort images as if they were affected by a black hole. The full description and a download link are here.

Enjoy :)

Part 3 - the metric

metryka1

We already mentioned the notion of the magnitude of a vector, but we said nothing about what it actually is. On a plane it's easy - when we move by v_x in the x axis and by v_y in the y axis, the distance between the starting and the ending point is \sqrt{v_x^2 + v_y^2} (which can be seen by drawing a right triangle and using the Pythagorean theorem - see the picture). It doesn't have to be always like that, though, and here is where the metric comes into play.

The metric is a way of generalizing the Pythagorean theorem. The coordinates don't always correspond to distances along perpendicular axes, and it is even not always possible to introduce such coordinates (but let's not get ahead of ourselves). We want then to have a way of calculating the distance between points \Delta x^\mu apart, where x^\mu are some unspecified coordinates.

(more…)

Part 2 - coordinates, vectors and the summation convention

The basic object in GR is the spacetime. As a mathematical object, formally it is a differential manifold, but for our purposes it is enough to consider it as a set of points called events, which can be described by coordinates. In GR, the spacetime is 4-dimensional, which means that we need 4 coordinates - one temporal and three spatial ones.

The coordinates can be denoted by pretty much anything (like x, y, z, t), but since we will refer to all four of them at multiple occasions, it will be convenient to denote them by numbers. It is pretty standard to denote time by 0, and the spatial coordinates by 1, 2 and 3. The coordinate number \mu will be written like this: x^\mu (attention: in this case it is not a power!). \mu here is called an index (here: an upper one). By convention, if we mean one of the 4 coordinates, we use a greek letter as the index; if only the spatial ones are to be considered, we use a letter from the latin alphabet.

(more…)

A new category - articles

I started thinking that since I already have a blog, I can use it for one of my favourite activities - passing some knowledge on to others. I decided to do my favourite topic first, that is, relativity and black holes. This field is widely being considered very complex mathematically and there are reasons for that, but a person with a high school education should be able to grasp the general picture in my opinion (assuming, of course, that they are interested in understanding the topic).

Therefore, I started a series of articles aiming to explain this fascinating field to the readers. Am I succeeding? See for yourself :)

Part 1 - partial derivatives

As I mentioned in the introduction, I assume that the reader knows what a derivative of a function is. It is a good foundation, but to get our hands wet in relativity, we need to expand that concept a bit. Let's then get to know the partial derivative. What is it?

Let's remember the ordinary derivatives first. We denote a derivative of a function f(x) as f'(x) or \frac{df}{dx}. It means, basically, how fast the value of the function changes while we change the argument x. For example, when f(x) = x^2, then \frac{df}{dx} = 2x.

But what if the function depends on more than one variable? Like if we have a function f(x,y) = x^2 + y^2 that assigns to each point of the plane the square of its distance from the origin. How do we even define the derivative of such a function?

(more…)

The mathematics of black holes

The science of gravity is being taught at schools as a part of the standard curriculum. Teachers say that bodies attract each other, they give the Newton's equation and that's about all. If it is at all mentioned that this is only a huge simplification of our current knowledge of this field, it is done so only on the side. The existence of something like General Relativity is only being hinted at - but it is not without reason. Full understanding of the mathematics behind that theory requires years of studying physics and is far beyond the reach of a typical high school student.

As a curious person, I was always interested in what this theory looks like and what is so hard about it. It was actually one of the main reasons that pushed me towards studying physics. I was eager to know what exactly is the curvature of spacetime and how to describe it. If it interests you, too - you are in the right place.

Thinking about this recently, I arrived at the conclusion that it should be possible to describe the basics of General Relativity using only high school mathematics. Therefore I aim to create here a series of articles in which I will explain the mathematical concepts behind GR and show how to use them to describe gravity - everything with the assumption that the most advanced concept known to the reader is that of a derivative of a function. If I succeed, we will see how the curvature of spacetime manifests as the attraction between bodies, how black holes affect time and why it is impossible to escape when you are inside.

So, feel free to read the series :) Remarks and suggestions are welcome as always.

New feature in the Black Hole Simulator

Today I added a new feature to the simulator, as suggested by Rexerex. It is an indicator of the time that passed infinitely far from the black hole. Thanks to it you can watch how the flow of time changes depending of the proximity of the black hole and the velocity of the ship.

You can find a more detailed description of the phenomenon at the project site.

Development of the site

The website begins to be mature enough to be shown to someone, so if you are reading this, apparently I already did that :)

Apart from two articles about the project concerning procedural generation of a universe, I added a list of my projects and started writing their descriptions. As of now I described the Black Hole Simulator and I'm considering adding a part with some maths (comments about that will be welcome). I will add descriptions of the remaining projects during the next few days.

Generating the structure of the universe

The structure of space

When creating a universe, you have to begin somewhere. A good starting point is to define its shape.

The most convenient and probably the most obvious shape is a cube. Each of the three coordinates is then a number from the same range and it is very easy to make it so that there are no boundaries - it is enough to add a condition that leaving the cube on one side is equivalent to entering it on the other side. It is similar to the well-known Snake game, where the snake leaving the screen on the right returned from the left - just in three dimensions.

So we have a cubic space made of points described by three numbers: x,\; y,\; z\; \in (a,b). A question arises: what data type will be best for representing the coordinates of a point? The answer requires us to check the size of the numbers involved first.
(more…)