- #1
d_m
- 2
- 0
Hello.
I have been folowing this forum for a while, but this is the 1st time I post. If I make any spelling mistakes, forgive me because I'm not an english born speaker.
My problem is the following, I have to write this program in C, and the graphical part is to be made in allegro or GTK+.
The program has 2 fixes masses, m1 and m2, over a rect horizontal line in the middle of the window, in which both the value of the masses as well as their distances are given by the user, and a 3rd mass, m3. The program will have to trace the movement of m3 in the gravitical field created by m1 and m2, oce the user gives the initial speed and position of m3 in the xy field.
I already know that i must 1st calculate the resultant force in m3, using F = G (m1.m2)/r2. Then I think I will have to use the equation F = m (d2 x(t))/(dt2) to get the position and speed of m3, but I'm not sure about how this is done.
My biggest problem is not about the mathematical/physical part of the problem, is about the programming part, because I'm not very good in programming in C.
Can anyone help me with this?
Thank you
I have been folowing this forum for a while, but this is the 1st time I post. If I make any spelling mistakes, forgive me because I'm not an english born speaker.
My problem is the following, I have to write this program in C, and the graphical part is to be made in allegro or GTK+.
The program has 2 fixes masses, m1 and m2, over a rect horizontal line in the middle of the window, in which both the value of the masses as well as their distances are given by the user, and a 3rd mass, m3. The program will have to trace the movement of m3 in the gravitical field created by m1 and m2, oce the user gives the initial speed and position of m3 in the xy field.
I already know that i must 1st calculate the resultant force in m3, using F = G (m1.m2)/r2. Then I think I will have to use the equation F = m (d2 x(t))/(dt2) to get the position and speed of m3, but I'm not sure about how this is done.
My biggest problem is not about the mathematical/physical part of the problem, is about the programming part, because I'm not very good in programming in C.
Can anyone help me with this?
Thank you