- #1
Hoofbeat
- 48
- 0
HELP! I'm trying to write a computer program (C) to plot the trajectory of the rocket as it flies from Earth to Moon. In the information sheet it says:
ax = -GMe*(1/rr^2)*(xr/|rr|) - GMm*(1/[rr-rm]^2)*([xr - xm]/[|rr - rm|])
Where:
ax = acceleration in x-direction (we're working in xy coords)
rr = a vector from the Earth to the Rocket
rm = a vectore from the Earth to the Rocket
xr = Rocket's x coordinate
xm = Moon's x coordinate
Me = Earth's Mass
Mm = Moon's Mass
Now, in order to input this acceleration in the x direction into my program I have to resolve the vector's into their x-direction BUT also be aware that their y co-ords will have an effect on the gravitational force felt in the x direction.
Could some-one explain to me what I actually have to compute then? Also, when it says "rr^2" does this mean the modulus squared?!
Please help, I'm really stuck! Thanks
Chloé
xxx
ax = -GMe*(1/rr^2)*(xr/|rr|) - GMm*(1/[rr-rm]^2)*([xr - xm]/[|rr - rm|])
Where:
ax = acceleration in x-direction (we're working in xy coords)
rr = a vector from the Earth to the Rocket
rm = a vectore from the Earth to the Rocket
xr = Rocket's x coordinate
xm = Moon's x coordinate
Me = Earth's Mass
Mm = Moon's Mass
Now, in order to input this acceleration in the x direction into my program I have to resolve the vector's into their x-direction BUT also be aware that their y co-ords will have an effect on the gravitational force felt in the x direction.
Could some-one explain to me what I actually have to compute then? Also, when it says "rr^2" does this mean the modulus squared?!
Please help, I'm really stuck! Thanks
Chloé
xxx