Coordinates of a Combined Center

Jakotheshadows

New member
Joined
Jun 29, 2008
Messages
47
I am writing a c++ program, and am stumbling over one of the functions I am trying to write.

The problem is that I have two 2 dimensional circles that lie on a cartesian plane and each circle has a mass.
With the center coordinates and mass for each circle, I want to return a combined center to my main function.
I have found a formula for the distance from the center of the first body to the barycenter, but I can not for the life of me figure out how to get (x,y) coordinates out of that distance.

barycenter formula:

r = a * ( massTwo / (massOne + massTwo)
where r is the distance from the first body to the barycenter and a is the distance between the centers of each body

I am capable of getting an equation of the line between the centers. I just need to compute the x and y coordinates of the barycenter. Any advice appreciated.
 
let ...

\(\displaystyle (x_1,y_1)\) be the coordinates of \(\displaystyle m_1\)

\(\displaystyle (x_2,y_2)\) be the coordinates of \(\displaystyle m_2\)

\(\displaystyle (x_{cm},y_{cm})\) be the coordinates of the center of mass (barycenter)

\(\displaystyle x_{cm} = \frac{m_1x_1 + m_2x_2}{m_1+m_2}\)

\(\displaystyle y_{cm} = \frac{m_1y_1 + m_2y_2}{m_1+m_2}\)
 
Top