Rewatching Star Trek: Voyager

So I’ve been rewatching Star Trek: Voyager recently, and thought I’d share some notes and observations. As a disclaimer, I had the show running mostly in the background, so I didn’t pay particularly close attention. Nevertheless, this re-viewing has pretty much solidified my conclusion that this series is my least favorite in the franchise. Let’s begin.

Captain Janeway

Oh, Captain Janeway…. I don’t think I agreed with a single command decision that she makes, starting with the very first episode where she decides to strand her crew in the Delta quadrant, and ending with the very last episode where she decides to travel back in time to help Voyager reach the Alpha quadrant sooner (because of how much she regrets her decision to stay in the Delta quadrant).

The complete, repeated disregard for the prime directive (including the Temporal prime directive) has me questioning her fitness for command.

At least she ends up where she belongs — in a women’s prison mashing potatoes for other inmates. #lockherup

Neelix

The Jar-Jar Binks of the Star Trek universe! It’s hard to believe he survived that long before coming aboard Voyager without being blown to bits by… pretty much anyone who encountered him.  And it’s also hard to believe he wasn’t killed off in any number of ways during Voyager’s seven-year journey.  Being strangled by Tuvok would have been a satisfying outcome, and this actually happens, but only as part of a holodeck simulation.  It’s as if the writers are fully aware of how annoying this character is, but just want to stick it to the audience.

Stupid and/or tedious enemies

The Kazon. We’ve seen all of this before. Generic humanoids with a prosthetic forehead and a bone to pick. No wonder Seska (a secret Cardassian) fits so well with the Kazon when she defects to them from Voyager — they are nearly identical species, except that the Kazon are much stupider and less cunning. How did they ever invent warp travel? In fact, the Kazon, the Ocampa, and the Caretaker can be very closely compared with the Cardassian / Bajoran / Prophets trifecta of Deep Space Nine, except the latter were explored much more deeply and meaningfully.

The Hirogen. We’ve seen this before, too: one-dimensional enemies that are given a single human characteristic that’s exaggerated to absurdity. Basically a blend of Klingons and Jem’Hadar, they are obsessed with “hunting” and “prey,” and made for some woefully tedious and predictable episodes.

On the other hand, there were some great enemies too, such as Species 8472, which deserved many more episodes than they got. The interplay between Voyager and Species 8472 became really nuanced, and I was looking forward to more stories with them involved, but it didn’t happen.

Notable cameos

One of the truly enjoyable things about re-watching this series was the cameos, some of which I hadn’t even realized until now. Imagine watching a random episode and thinking, “Hold on, isn’t that… Scott Thompson?!” Why yes, it is — he makes a guest appearance in the episode Someone to Watch Over Me, and is delightful as always.

Other welcome appearances include Jason Alexander, who plays the leader of the “brain trust” in the episode Think Tank. I kept chuckling whenever he spoke. And of course there’s Sarah Silverman, an up-and-coming comedian at the time, who plays the nerdy-but-sexy SETI researcher in Future’s End.

Time travel as filler

A noticeable fraction of the episodes are time travel stories where most of the episode happens in an alternate timeline which, by the end of the episode, resets to the beginning without the crew knowing that anything happened. This makes the episode completely pointless, unless it’s redeemed by some meaningful character development, which it generally isn’t. Here are just a few such episodes that I can recall:

  • Time and Again, in which the Voyager crew detect a planet that has undergone a catastrophe, but it turns out that the crew themselves are the ones who cause the catastrophe in the future. Once they manage to prevent it from happening, the timeline resets to the beginning, with all the events of the episode never having taken place.
  • Timeless, in which, fifteen years in the future, Chakotay and Harry Kim correct a mistake that happened fifteen years prior, which had caused the destruction of Voyager and the rest of the crew. Once the mistake is corrected, the timeline is reset, with the events of the episode never having taken place.
  • Year of Hell (a two-parter), in which the crew is faced with a species that is bent on tampering with the timeline in order to become the most prosperous and dominant species in the sector. They do this using a ship that can fire a “temporal incursion” beam that erases any object from ever having existed. When Voyager finally manages to destroy the temporal incursion ship (without any help from the 29th Century time police, who should have been there, right?), the timeline is reset, with the events of the episode never having taken place. Note: this episode had a huge redeeming factor in the form of Kurtwood Smith, whose performance made the episode more watchable than most.
  • Relativity, in which a renegade captain from the 29th century is obsessed with destroying Voyager because he’s fed up with all the trouble they’ve caused with their time traveling (I know how he feels!). Once this captain is apprehended, the timeline is restored, with the events of the episode never having taken place.

I’m fairly certain there are a few more that I didn’t mention, but you get the idea. It feels like the writers would too often fall back on the “alternate timeline” / “it was all a dream” trope, rather than explore more meaningful ways to advance the story or develop the characters.

“Science”

What good would a dissection of a Star Trek series be without a few nitpicks of the science and technobabble that they use? The science explored in Voyager is laughably terrible, as it often is in Star Trek, but fortunately it’s laughable in a good way. As in, it’s so absurd that it overflows into being humorous.

Remember when Voyager gets stuck inside the event horizon of a singularity (in the episode Parallax) and pokes a hole through it using warp particles? And when Neelix mansplains the event horizon to Kes with utter nonsense? Oh man, that’s the good stuff.

Perhaps the most absurd episode, to the point where I felt stupider after watching it, was Threshold, which is the one where Tom Paris builds a shuttlecraft that can achieve Warp 10, which is “infinite speed.” Mind you, the scientists and theorists at the Daystrom Institute have spent centuries refining warp technology to attain this goal without success, but Tom Paris (a random-ass pilot without any scientific background) does it in a few days.

The crew acknowledges that this is an impossibility (since traveling at infinite speed would mean occupying all points in the universe simultaneously), but Tom does it anyway! Of course, after attaining Warp 10, Tom starts to experience some changes: he abducts captain Janeway to a distant planet, where they de-evolve into giant salamanders, and have salamander babies. But don’t worry, the crew finds them soon enough, and the Doctor restores them to human form, with all their memories and skills intact. What happened to the salamander babies, which are now the most unique species in the entire universe? Ehh, who cares. (Whoops, spoilers!)

Conclusion

A few memorable episodes, some pretty good performances (especially by Robert Picardo as the Doctor), but the premise and overall dullness and repetitiveness of the episodes makes it more suited for running in the background rather than the foreground.

Ray tracing black holes

Lately I’ve been studying up on ray tracing, and one of my goals has been to build a nonlinear ray tracer — that is, a ray tracer that works in curved space, for example space that is curved by a nearby black hole. (See the finished source code!)

In order to do this, the path of each ray must be calculated in a stepwise fashion, since we can no longer rely on the geometry of straight lines in our world. With each step taken by the ray, the velocity vector of the ray is updated based on an equation of motion determined by a “force field” present in our space.

This idea has certainly been explored in the past, notably by Riccardo Antonelli, who derived a very clever and simple equation for the force field that guides the motion of the ray in the vicinity of a black hole, namely

$$\vec F(r) = – \frac{3}{2} h^2 \frac{\hat r}{r^5}$$

I decided to use the above equation in my own ray tracer because it’s very efficient computationally (and because I’m not nearly familiar enough with the mathematics of GR to have derived it myself). The equation models a simple Schwarzschild black hole (non-rotating, non-charged) at the origin of our coordinate system. The simplicity of the equation has the tradeoff that the resulting images will be mostly unphysical, meaning that they’re not exactly what a real observer would “see” in the vicinity of the black hole. Instead, the images must be interpreted as instantaneous snapshots of how the light bends around the black hole, with no regard for redshifting or distortions relative to the observer’s motion.

Nevertheless, this kind of ray tracing provides some powerful visualizations that help us understand the behavior of light around black holes, and help demystify at least some of the properties of these exotic objects.

My goal is to build on this existing work, and create a ray tracer that is more fully featured, with support for other types of objects in addition to the black hole. I also want it to be more extensible, with the ability to plug in different equations of motion, as well as to build more complex scenes, or even to build scenes algorithmically. So, now that my work on this ray tracer has reached a semi-publishable state, let’s dive into all the things it lets us do.

Accretion disk

The ray tracer supports an accretion disk that is either textured or plain-colored. It also supports multiple disks, at arbitrary radii from the event horizon, albeit restricted to the horizontal plane around the black hole. The collision point of the ray with the disk is calculated by performing a binary search for the exact intersection. If we don’t search for the precise point of intersection, we would see artifacts due to the “resolution” of the steps taken by each ray (notice the jagged edges at the bottom of the disk):

Once the intersection search is implemented, the lines and borders become nice and crisp:

We can also apply different colors to the top and bottom of the disk. Observe that the black hole distorts the disk in a way that makes the bottom (colored in green) appear around the lower semicircle of the photon sphere, even though we’re looking at the disk from above:

Note that the dark black circle is not the event horizon, but is actually the photon sphere. This is because photons that cross into the photon sphere from the outside cannot escape. (Only photons that are emitted outward from inside the photon sphere can be seen by an outside observer.)

If we zoom in on the right edge of the photon sphere, we can see higher-order images of the disk appear around the sphere (second- and even third-order images are visible). These are rays of light that have circled around the photon sphere one or more times, and eventually escaped back to the observer.

And here is the same image with a more realistic-looking accretion disk:

Great! Now that we have the basics out of the way, it’s time to get a little more crazy with ray tracing arbitrary materials around the black hole.

Additional spheres

The ray tracer allows adding an unlimited number of spheres, positioned anywhere (outside the event horizon, that is!) and either textured or plain-colored. Here is a scene with one hundred “stars” randomly positioned in an “orbit” around the black hole (click to view larger versions of the images):

Notice once again how we can see second- and third-order images of the spheres as we get closer to the photon sphere. By the way, here is a similar image of stars around the black hole, but with the curvature effects turned off (as if the black hole did not curve the surrounding space):

And here is a video, generated using the ray tracer, that shows the observer circling around the black hole with stars in its vicinity. Once again, this is not a completely realistic physical picture, since the stars are not really “orbiting” around the black hole, but rather it’s a series of snapshots taken at different angles:

Notice how the spherical stars are distorted around the Einstein ring, as well as how the background sky is affected by the curvature.

Reflective spheres

And finally, the ray tracer supports adding spheres that are perfectly reflective:

All that’s necessary for doing this is to calculate the exact point of impact by the ray on the sphere (again using a binary intersection search) and get the corresponding reflected velocity vector based on the normal vector on the sphere at that point. Here is a similar image, but with a textured accretion disk:

Future work

Eventually I’d like to incorporate more algorithms for different equations of motion for the rays. For example, someone else has encoded a similar algorithm for a Kerr black hole (i.e. a black hole with angular momentum), and there is even a port of it to C# already, which I was able to integrate into my ray tracer easily:

A couple more ideas:

  • There’s no reason the ray tracer couldn’t support different types of shapes besides spheres, or even arbitrary mesh models (e.g. STL files).
  • I’d also like to use this ray tracer to create some more animations or videos, but that will have to be the subject of a future post.
  • Make it run on CUDA?

Dear Pittsburgh, please drive better!

One of my favorite activities is to go running through the neighborhoods of Pittsburgh. I used to judge my runs based on the distance I covered, or the pace I achieved, or the total time I ran without stopping. But these days, I judge my runs based on how many times I nearly get killed by a passing motorist.

I don’t know if this phenomenon is specific to Pittsburgh (seems like it might be), or is more widespread throughout the country, but drivers have gotten significantly worse in the last few years. It’s now genuinely, literally dangerous to be on the road, whether you’re a fellow motorist, cyclist, or pedestrian.

Since our state requires a driving test only when first acquiring a license, and pretty much never again afterwards, I can see how it might be easy to forget the simple rules of road safety, so allow me to reiterate a couple of them while I have your attention (and feel free to pass these along to someone who you think might need a reminder):

The red octagonal symbol with the letters “STOP” inscribed in it means exactly what it says: stop, fully and completely, at the white line that is painted underneath it for your convenience. While stopped, take note of your surroundings, and check whether someone is about to cross the road in front of you, in which case remain stopped until the crossing is complete.

Of course the red sign mentioned above, as well as other signs, are only effective if you actually see them, which you can’t do if you’re looking at your phone instead. When you’re in the middle of driving your vehicle, put your phone down and do not look at it. Start your voice navigation app before leaving. Answer your friend’s text after you reach your destination. No matter how much you believe that you’re superior to other drivers and possess the attention bandwidth to do both things at once, you actually don’t. Please don’t wait until this fact is proved to you in the most tragic way possible.

There’s a theory that drivers have gotten more complacent because the safety features of our cars have gotten more advanced and sophisticated, so we can “afford” to pay less attention to the road. But the reality is that the sense of safety given by our modern vehicles is often a false one, driven by marketing tactics rather than actual data. It is never OK to let your attention to the road slip, and it’s never OK to use your own personal rules for obeying traffic signs.

So please, Pittsburgh, drive better!

Simple ray tracing in pure Javascript

As a quick diversion, I recently followed Peter Shirley’s excellent Ray Tracing in One Weekend guide, which is a terrific refresher of the surprisingly simple math involved in ray tracing.  And in the spirit of Atwood’s Law, I decided to do it in Javascript, since I don’t work with Javascript very often, and thought I could use a refresher in it, as well. The result is some relatively passable Javascript code (which is slow as hell!), but some really pretty pictures:

Some possible future work might be to create a renderer for black holes (in addition to regular spheres) which would actually curve the surrounding space and affect the direction of the rays. This would necessitate a radically more complex ray tracer, which would need to follow the path of the ray in a stepwise fashion using Boyer–Lindquist coordinates within the Kerr metric. Perhaps a project for another weekend (or two)!

Joe Rogan: savior of political discourse

Few things in recent memory have resonated with me as much as Meghan Daum’s outstanding Medium article on the subject of the “intellectual dark web” and the ongoing erosion of nuance in today’s political climate, minus the heartbreaking divorce story.

Three years ago, I would have considered myself mostly apolitical. We had our first black president and were well on our way to having our first female president. The economy had recovered from the 2008 recession. Everything was going well, without me needing to take any notice of political matters. And then something happened in 2016 that kick-started my interest in politics, as it did for so many other people.

Prior to election day, 2016, I drove around the suburbs of Pittsburgh, Pennsylvania, and was noticing a curiously large number of Trump signs on people’s front yards. Listening to the news, I would hear the broadcasters pleading with young people to “get out and vote,” and all I kept thinking was, “careful what you wish for.”

And then it happened: half of the American people (nearly half, that is) voted for a megalomaniacal, egotistical, misogynistic, late-night-tweeting, barely-coherent reality TV star, just for the purpose of rubbing in how much they hated his opponent, Hillary Clinton.

Since then, I’ve endeavored on a quest to understand the Trump voter, or more precisely to understand what enabled Trump, what gave birth to the idea of him as our president. This quest is still in its infancy, but there is one thing that stands out as a major contributor to our current state of affairs: our conversations have gotten more and more polarized, and any hint of nuance has been virtually extinguished.

The idea of “disagreement” on political matters has shifted from a chance for a healthy debate to instant knee-jerk responses of insult and offense. The problem exists on the Left and the Right. If you speak to a right-winger and broach the idea of socializing healthcare, you’re automatically an SJW soyboy cuck. And if you speak to a left-winger and broach the idea of limiting immigration from predominantly Islamic countries, you’re automatically a racist.

Much has been written on the rise of “victimhood culture,” which is what the Right perceives is happening to the Left. They believe the Left has become obsessed with identity politics, with minority groups competing for who is the most oppressed, researching where these groups intersect and thereby carving out even more oppressed minorities. College campuses have become “safe spaces” that stifle free expression and protect students from radical or dangerous ideas, they say, and many of today’s professors and academics are proudly Marxist and long for the next proletarian utopia that will inevitably usher in a new Gulag archipelago.

Conversely, as a response, the Left have developed a tendency to lump together any kind of dissenting opinions into the same category, react to them with the same magnitude of revulsion, and even to misrepresent and inflate statements made by centrists or center-leftists, and brand them as “alt-right-adjacent,” further alienating people who would otherwise be their allies. They are convinced that any deviation from a perfect liberal progressive narrative will necessarily lead to white nationalism, misogyny, homophobia, trans-phobia, and fascism.

The reason for all of this polarization is, to me, plain as day: Twitter. Here we have a social network that literally forces us to condense our most deeply-held beliefs into a single sentence, into a slogan, or a hashtag. It is, of course, impossible to do this without grossly oversimplifying our beliefs, or without turning them into statements that sound profound but are actually meaningless (or turning them into “deepities,” as Dan Dennett calls them).

When we communicate with each other using nothing but slogans, what do you think will happen? It’s much easier to argue against a slogan using an equal-and-opposite slogan. It’s also much easier to take offense when someone rejects your slogan because of the beliefs you’ve poured into it. Twitter then compounds the problem by rewarding this behavior in the form of encouraging “likes” and “retweets,” giving rise to a competition of one-liners which can only be won by making your slogans all the more extreme. Is it any wonder, then, that Twitter is Donald Trump’s favorite platform for conveying his messages? Is it any wonder that Twitter creates bubbles and echo chambers where like-minded individuals egg each other on, often anonymously, to behave more and more extremely? And is it any wonder that Twitter can be so easily manipulated my malicious external forces who might want to influence our democratic process?

There is, however, a glimmer of hope. The last couple of years have seen the growing popularity of long-form discussions and debates in the form of podcasts, YouTube videos, and even live events. Joe Rogan’s podcast is one of the spearheads of this movement. Despite each episode being two to three hours long, it receives over 100 million downloads per month. To me, this level of popularity indicates a real craving for these kinds of discussions among the general public. People are getting tired of being angry at each other, and are demonstrating a willingness to listen to the whole story, a need to understand their opponents’ ideas before drawing conclusions.

On his podcast, Joe Rogan doesn’t prepare any specific questions or impose any kind of structure; he simply invites his guest to shoot the shit for two hours, and let the conversation or debate come about naturally. His interviewees come from all walks of life: MMA fighters, sports players, actors, musicians, writers, businesspeople, scientists, and more pertinently to this discussion, political commentators (in which all of the previous professions can also take part).

He has interviewed most of the major figures of the “intellectual dark web,” such as Jordan Peterson, Sam Harris, Bret and Eric Weinstein, Michael Shermer, etc. Many of these public figures have their own podcasts and YouTube channels, such as Sam Harris’s Waking Up podcast and Michael Shermer’s Science Salon. And many are also active on the live debate circuit — as Harris likes to point out, by doing nothing more than putting a date on a calendar, he can witness thousands of people fill the theatre hall to watch him debate his opponent.

It’s these intellectuals that are considered by some leftists to be “gateway drugs” to the alt-right, since some of their statements, crossing certain political trip-wires, can be seized upon to demonstrate a superficial sympathy with the alt-right. However, anyone who takes the time to listen to the full conversation, instead of a clickbait sound bite or an out-of-context quote (on Twitter, of course), will understand that this cannot be further from the truth. Saying that these people are gateway drugs to the alt-right is like saying that mountain climbing is a gateway drug to jumping off a cliff.  By the way, “intellectual dark web” is really a silly term for it, since it implies a well-defined club with which these people identify, or even some kind of groupthink among the people in it, which also cannot be further from the truth. The opinions of these intellectuals are as diverse as they come.

More importantly, however, Joe Rogan often interviews guests with whom he doesn’t agree (and neither do I). This includes provocateurs and opportunists like Milo Yiannopoulos and Candace Owens, as well as prominent farther-right figures like Ben Shapiro, Gavin McInnes, and Steven Crowder. At points when they disagree blatantly enough, or when they are factually incorrect, Rogan calls them out. But for the most part, he patiently lets them lay out their views and make all their arguments to support them. And from this style of conversation, as vehemently as I might disagree with them, I can take away a few important points: a) they are all human beings with strengths and weaknesses, b) they are not wrong about everything, c) at the points where they are wrong, I can analyze exactly why they’re wrong, what led them to these conclusions and what I can do to avoid those conclusions myself, and d) I can disagree with them without considering them irredeemable.  But that’s merely my takeaway from these discussions. Yours may be different, and that’s OK — let’s talk about it.

I am now virtually convinced that Joe Rogan’s show, and similar shows that are springing up all the time, is the antidote to the abject cesspool of vitriol that Twitter has become. In the coming months and years, I hope for a mass exodus of users from Twitter to more meaningful, unabridged, unedited conversations, where people will truly understand the nuances of the issues that impact our society, and make more informed decisions based on knowledge and facts instead of emotionally charged placards in the form of tweets.  This can only be a benefit to our democracy, our civilization, and our planet.