# 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 between 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 how to add equations to this new Astronomy beta).

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.

-