Lately I’ve been strongly interested in space exploration. It probably has a lot to do with my diminishing interest in programming. I think the seed of my new interest started from seeing SpaceX landing orbital boosters. It looks so epic, especially the Falcon Heavy launch where they landed 2 boosters at once. Over time I found myself watching all kinds rocketry or space themed videos on youtube. Then I started playing Kerbal Space Program and my interest amplified even more. Definitely the best educational game I’ve played, I wish other engineering fields also had some kind of fun games to get an intuitive feel of the core conceps.
Many people are into rockets and stuff when they’re kids, but I don’t think I was ever into that when I was little. Looking in the sky at night and feeling so little and irrelevant probaby doesn’t count as that. Now I can’t get my thoughts off all the unexplored worlds up there. I often go to walks early in the morning/night and last week I noticed this redish pink dot in the sky, visible for much longer than other stars. My guess was that it was not a star, but Mars. That’s indeed what it turned out to be. Turns out Mars is very close to earth right now. Earlier I would not have noticed or even cared.
The problem however, is that it’s quite hard to find an output for that interest. Launching rockets costs millions of dollars. Not really something you would tinker away with in your garage. Right now I don’t even have the resources to start with something simple like R-Candy rockets or PVC and nitrous oxide. Eventually I would want to start doing something like that, but for now I have to find other ways.
Few weeks ago I was listening to a podcast on one of my early morning walks. It was about colonizing Mars, like how to get there, interviews with some of the people involved and the technology it takes to make it habitable. From there I heard about the book “The Mars Project” by Wernher von Braun, which has been very influential book on planning Mars missions. The book has very technical story about a manned mission to Mars. I’ve only finished about 9 chapters so far and I’ve quite liked it. I’m not the kind of person that has easy time reading books. I’ve tried to avoid them as best as I can so far.
Another thing I can do besides reading books is getting technical knowledge about how space travel works. Like orbital mechanics, how rocket engines work, aerodynamics, remote control etc. Staring at a Wikipedia page doesn’t really cut it for me, to internalize knowledge I have to work through it from ground up. For orbital mechanics playing KSP gives a good idea of how the maneuvers work, but in real life you couldn’t launch 10 rockets by trial and error. Thus I’ve been trying to get a grasp on the math underneath.
So I’ve started with a simple program than can draw an orbit given 2 masses, velocity and position. I did it with javascript using three.js rendering library, I’ll insert it into this post below. I tested it with actual data of moon and earth and it seemed about what you would expect. The demo doesn’t have user friendly way to scale right now, so I guess I can’t really show that. Also it assumes m1 mass is so much larger that that m2 doesn’t affect it at all.
You can move the red (position) and cyan (velocity direction) dots. Also you can set masses and velocity at top. I think it demonstrates quite well why rockets eventually turn and don’t go straight up. If they did, they would either fall back down or reach escape velocity (hyperbolic trajectory).
Anyways, here it is: (requires WebGL support I think)