Lightspeed on Your Desktop
One area of physics that is hard to wrap your head around is relativity. Basically, relativity breaks down into general and special relativity. General relativity deals with large masses and high energies, and it describes how space-time is warped by these. Special relativity deals with what happens during high velocities. Many odd and counter-intuitive effects happen when speeds get close to the speed of light, or c. The problem is that these types of conditions are quite far outside normal experience, so people don't have any frame of reference as to what these effects would look like—enter Lightspeed.
Lightspeed is an OpenGL program that shows what an object would look like as it travels closer and closer to the speed of light. Lightspeed actually models four different effects that occur when you get close to the speed of light. The first effect is called Lorentz contraction. This effect causes objects to appear to shrink in the direction of travel. This is scaled by a factor called gamma. Gamma is calculated by:
1 / sqrt(1 - v2/c2).
So, as you can see, as your velocity (v) gets closer to the speed of light (c), the value gamma increases toward infinity. The length contraction is calculated by
l' = l / gamma.
This means the length of an object in the direction of travel (l) decreases toward zero as the velocity increases toward the speed of light.
The second effect that Lightspeed models is Doppler shifting. You probably have noticed the sound version of Doppler shift when a fire truck drives by with its siren on. You can hear the shift in sound frequency from high to low as it goes by. The same thing happens with light too. As a light source comes toward you, it shifts in color toward blue. As it goes away, the color shifts toward red.
The third effect is something called the Headlight effect. When you have a light source that is moving, the amount of light being emitted isn't the same in all directions if that light source is moving. If the light is coming toward you, it will appear brighter. If it is moving away from you, it will appear darker.
The last effect that Lightspeed models is something called optical aberration. Because light travels at a finite speed, the light from different parts of the object come to you at different times. The end effect is that as an object comes toward you, it looks stretched out. And, when it travels away from you, it looks squashed. This is actually different from Lorentz contraction.
So, how can you see what an object would look like, taking all of these effects into account? This is where Lightspeed comes in. Most distributions should have a package available that you can install using their package management system. If you are interested in building from source, it is hosted at SourceForge. When you first start it up, it opens with a cube set in the middle of a field made up of rods for the edges and balls for the vertices (Figure 1). The beginning velocity is set as 1m/s. Since this is an OpenGL program, you simply can grab the cube with your mouse and spin it around, or up and down, in order to change the view of the object. At the far right, you can set the velocity that the object has relative to you, going from 1m/s all the way up to 299,792,457m/s (the speed of light is 299,792,458m/s).
Figure 1. Initial Scene on Starting Lightspeed
Joey Bernard has a background in both physics and computer science. This serves him well in his day job as a computational research consultant at the University of New Brunswick. He also teaches computational physics and parallel programming.
Practical Task Scheduling Deployment
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- The Firebird Project's Firebird Relational Database
- Stunnel Security for Oracle
- My +1 Sword of Productivity
- SUSE LLC's SUSE Manager
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Doing for User Space What We Did for Kernel Space