# How to calculate the movement of the object passing near other object in space?

Assume object A is moving through the space and is passing near the other object (B). Assume the gravitational influence of other objects can be ignored. How to find the equation describing the movement of the object B?

There are 2 cases, object A is moving straightforward or it's moving on orbit (around other object).

I think the problem is quite elementary, but I couldn't find anything that could help solve that problem using the physics on the level of basic university course (I've studied computer science, so I've got only 1 semester of physics, and basic mathematical knowledge - integrals, algebra etc.).

I know the problem can be solved numerically, but I'm interested in finding the equation describing the movement.

• Are you looking for something like the speed or distance between object A and B? – astromax Sep 24 '13 at 21:17

Since you're interested in the equations of motion, I would solve this problem by using Lagrangian mechanics. Essentially, find the kinetic and potential energies for these two bodies, A and B.

Construct the Lagrangian:

$$L = T - V$$

where T is the kinetic energy, and V is the potential energy. Then use the Euler-Lagrange Equation to achieve the equations of motion (I would add it here, but I'm not sure of the specifics of your problem).

Two-body motion can always be constrained to a plane, so you may have to throw a constraint in there through the use of a Lagrange multiplier.

It isn't clear to me if you are merely interested in the equation so that you can plug numbers in and figure it out, or instead would like to understand how the equation is derived. Either way, is called the two-body problem and with that as a search key, it should not be hard to find online references explaining the derivation and illustrating the equation, such as http://en.wikipedia.org/wiki/Gravitational_two-body_problem and http://en.wikipedia.org/wiki/Two-body_problem

You refer to there being two cases, one where A is moving "straightforward" and one where A is orbiting B. This is the same problem, as your first one where 'A is moving straight forward' implies no influence, no gravitational effect from B at all, i.e. it isn't there. If it is there, there is a two-body gravitational effect, which makes it the second case.

• Comets passing near earth can be approximated using the two-body equations. He doesn't say ignore gravity between A and B, but ignore other objects, ie. two-body. And there is no case where one object could travel in a straight line unaffected by the other object! Both would be pulled in towards each other. There is a case where one object orbits another, and one where they just pass, pulling at each other slightly, but these are actually just the same when it gets down to the nitty gritty. – Jeremy Sep 26 '13 at 11:07