SamuKata
Bartosz Ciechanowski
Bartosz Ciechanowski

patreon


On "GPS"

When I started working on the article, I quickly realized that to explain GPS, I'd need to talk about trilateration first. To do that, I originally considered using some sort of "treasure hunt" story to justify the need for trying to relate one's position in the world to a position on the map. However, I'm not a huge fan of fable-like fiction used as a device to smuggle in technical concepts, so I dropped that idea and went with a straightforward "let's build a positioning system" as is. I think it was the right choice, because then I didn't need to drop that contrived story halfway through when I started talking about real GPS satellites.

I usually find it a bit difficult to figure out how to start with simple ideas and end with fairly advanced concepts, all in a way that feels natural. The first part of the article was especially challenging in that regard. The individual steps of measuring tapes, drones, sounds, and clocks took a while to iron out, but I'm satisfied with that progression. I was particularly excited about coming up with the idea to use little drones, as they convey the "time of flight" concept very literally.

In the article I made the conscious choice to avoid talking about the concept of triangulation. That word is commonly used as a generic term for figuring out where something is based on measurements. However, triangulation is about measuring angles, while trilateration is about measuring distances. I didn't mention triangulation at all because I didn't want the reader to have that word lingering in their mind after reading the post.

One of the biggest points of contention was interaction between GPS and relativity. The mantra of GPS becoming useless within a day if it didn't apply any relativistic correction is repeated in so many places and I always took it for granted. However, after learning how trilateration with pseudoranges works, those statements didn't feel quite right. My uneasiness was justified by others who also questioned that dogma. I was eventually convinced that the bulk of those assertions were indeed incorrect, but for final confirmation I emailed prof. Pratap Misra, coauthor of the Global Positioning System book. He quickly responded confirming my assumptions, which was a huge relief.

While working on the article, I was also planning to reach out to prof. Per Enge, the other coauthor of the textbook and one of the lecturers in the video course, but I was saddened to learn that he died a few years ago. Seeing his enthusiasm for GPS in the recordings, it's easy to realize that we've lost a great advocate and teacher of that technology.

When I first start working on a topic, I usually have one or two things in mind that I really want to visualize. For GPS it was the heat map of satellite coverage of different parts of Earth. It actually ended up not as interesting as I thought it would be, but I think it's pretty cool to see how that coverage changes over time without any discernible patterns.

I'm very happy with how the visuals for the small landscape in the first part of the article turned out. Other than the growing spheres of sound waves, they're completely drawn with plain 2D canvas API since that was very convenient to use. For instance, the body of the yellow figurine is just two short lines of different thicknesses and rounded caps drawn on top of each other, and so is the figurine's head. The measuring tapes were also easy to draw with just some dashed lines. I originally wanted the flat 2D map to have more of a folded look, but then that wouldn't make much sense when the map is rotated around in 3D so I abandoned this idea.

For some reason, I really enjoyed designing the clocks. It's still surprising to me how easy it is to make things look reasonably good with just a few gradients. I also couldn't resist adding the detail of the watch's crown getting turned when the bias is adjusted with a slider.

There were two little demos that I spent a bit too much time on. The first one was the rope simulation, which uses a simple relaxation algorithm that runs a number of iterations over a set of sections of the rope – I'm fairly sure that I originally saw this idea in Sebastian Lague's excellent video. It worked very well for that demonstration. I tried tweaking the algorithm to simulate the rope's resistance to bending, but ultimately I ended up using the initial implementation since it behaved convincingly and was fun to play with.

The second time sink were the animated clouds in some of the demonstrations where Earth rotates around its axis. I wanted the clouds to be placed in convincing arrangements, so I opted for some deformations of a plain image of clouds downloaded from NASA's website. Ideally, their movement would have more of a curl to it, but I struggled to make something from scratch, and I didn't want to just copy code from a random shadertoy so I ended up coding a simple distortion through noise. It doesn't look amazing, but at the small scale it's usually displayed, it gives a convincing representation of the clouds moving around a little.

It took me some time to figure out how to introduce the shape of an ellipse. I was toying with an idea of using conic sections to present that concept, especially since that would easily extend to the hyperbolic trajectory of some orbits, but I ultimately fell back on the string and pins. While mathematically beautiful, I feel that the notion of slicing a cone is not very tangible to most people as it is quite abstract. On the other hand, the string and pins approach can be recreated by anyone at home.

The orbital demo was a lot of fun to play with. While the drawn elliptical orbits are calculated from the object's position and velocity, the object's motion is completely simulated by simply applying gravitational force on every frame of the simulation. It was exciting to see in practice how all three laws of Kepler emerge from Newton's law of universal gravitation.

The final section dedicated to GPS signals is probably the weakest part of the article. I did find the ideas interesting enough that I thought they deserved to be presented, but it's not easy to visualize these concepts in an attractive way. It ultimately ended up being a series of many animated plots which can get a bit boring.

At over 9000 words this is my longest article so far, and think it pushes the limits of a reasonable length. I'm not sure what the sweet spot is, but, for my own sanity, I'll try not to approach these size too often.

Comments

I enjoyed the work you did on the GPS article. Looking forwards to reading your future articles.

Shiva Ramasami


More Creators