# Determine whether A is orbiting B

Hello,

I'm looking for a way to determine wether one object is in a closed elliptical orbit around another based on their mass and state vectors. For instance, if looking at the state vectors of the distant irreguar Jupiter-moon Sinope and of an asteroid passing by Jupiter at the roughly same distance and velocity, it wouldn't be obvious that one was just barely orbiting the planet and the other one wasn't. How do I calculate this from their mass, position and velocity vectors?

Cheers,
Mike

$$E = \frac{1}{2}m_1|\vec{v_1}|^2 + \frac{1}{2}m_2|\vec{v_2}|^2 - G\frac{m_1m_2}{|\vec{r_2} - \vec{r_1}|}$$ If ##E < 0## then the system is bound, and the two bodies orbits about the center of mass in elliptical trajectories.
$$E = \frac{1}{2} \mu|\vec{v}|^2 - G\frac{M \mu}{|\vec{r}|}$$