Red/Blue Shifting Visualization

Small Particle Simulation made to visualize the concept of Red and Blue shifting in astrophysical observations. This is the result of a doppler effect on the light waves emitted from an object, causing them to shift to the blue or red end of the spectrum depending on their relative velocity to the observer. Redshifting can also occur when massive gravity forces distort the light, and from the expansion of the universe when light travels very far distances.

The two systems used here is a simple implimentation of Newton’s Gravity Equation as a force driving the particles to orbit a certain point. This point, refered to in my nodes as the ‘Gravity Object’ acts as the source of gravity the points orbit, and the position of the observer, to whom the particle objects’ observed hue would be red and blue shifting.

Then to represent the hue shifts, I compared the vectors of velocity and the vector of position with the observer as the origin. This meant I could compare the lengths of this vector sum with the absolute scenarios of the particle moving directly toward the observer and directly away from. This meant I could find out how far from either absolute the particle was regardless of it’s orientation. I then just mapped the particles color on a range of blue to red, with red being pointed away and blue being pointed towards.