Tuesday, 20 September 2011

More on Barycenters

Picking up a bit where I left off. According to someone with a Phd on a forum that knows a great deal about astrophysics, there was absolutely nothing wrong with my rendition of a barycenter orbit. The shifting of the barycenter if no "counter velocity" is established for the more massive body will occur because momentum must be conserved. Makes sense.

Anyway, here is a representation of the same barycenter orbit, the white one leaving the visual representation (the frame of reference) as it is, the orange one "correcting" the positions so that it appears that the more massive body is "stationary". It is a visual trick, they are really the same orbit.



And here's the "correcting" code.

barycenter_length = radius * (charon_mass / (charon_mass + pluto_mass));
bary_x = sin(angle_to_charon) * barycenter_length;
bary_y = cos(angle_to_charon) * barycenter_length;


Then, this code keeps the more massive body centered...

pluto_x + bary_x
pluto_y + bary_y

And so on for Charon. That is, by the way, the formula for establishing a barycenter;

Bc = Radius * (lesser_mass / (lesser_mass + greater_mass))

I am sort of up to my eyes in work this month, so progress will be slow.

'Till the next!

No comments:

Post a Comment