Hi!
I want to write a program, which calculates and draws the path of a planet around a sun. Actually it just draws the planet and the sun (and the velocity and the gravity force vectors). The sun is still, it doesn't move, just the planet is moving. The planet has got some velocity at the t=0 time point.
I use OpenGL, actually I changed the sample OpenGL program of Dev-C++.
The gravity force formula by Newton is as follows:
F = f*m*M/(r^2)
where f=6,67e-11
m is the weight of planet, M is the weight of sun
r is the distance between the centers,
assuming that the planet and the sun is a sphere, F is measured by Newton, m and M by kg and r by meter.
In my program the coordinate system is from -1 to 1 by both x- and y-axes, I don't know how to change it to a good range. So r is at maximum 3 (m).
My problem is, that with these distances, if I use the weight of planet and sun as it is in the nature (e24 and e30) and f (e-11), the gravity force is so big that the planet moves abnormally.
My question is, how should I change the datas to make the program work correctly. A good ratio may solve it, but I'm not sure.