# Given mass, position and eccentricity, is there a way to get initial velocity in a 2-body problem?

I know that the we can get the eccentricity vector like that: $$\mathbf{e} = \frac{\mathbf{v} \times \mathbf{h}}{\mu} - \frac{\mathbf{r}}{\|\mathbf{r}\|}$$ (source: https://astronomy.stackexchange.com/a/29008/42546 ).

I would like to know if there's a way to get one of the initial velocity vectors $$\mathbf{v}$$ (I believe there's 2) of the lightest of the bodies, given the mass, the position $$\mathbf{r}$$ and the eccentricity (not the vector) in a 2-body problem ?

What I'm trying to do is a planetary system procedural generator and I would like, when I put initial velocity for each body, for the eccentricity to be near 0 and never equal or greater than 1 (so every orbit is elliptical); if it's impossible using eccentricity but you see another way to achieve that, I'll take it.

Thank you !

• The vis-viva equation gives valid velocity values for up to $2a>= r$. But to reverse-engineer the velocity vector $\vec{v}$ from the radial distance vector $\vec{r}$ and the eccentricity $e$ you'll need at least a little more information, such as the semimajor axis $a$, some way to specify the orbital plane, and some way to decide whether the object is ascending or descending at that point on its orbit. Aug 18, 2021 at 15:21
• No, you cannot because with only mass, position, and eccentricity you don't know the orbital plane. Aug 18, 2021 at 15:38
• @DavidHammen I was hoping that getting a speed would be good enough, missed that the question asked about vectors. Treating this as a 2D problem instead, I wonder if given $M, r$ and $e$ one could still solve for $|v|$? It seems like that should be doable somehow.
– uhoh
Aug 18, 2021 at 16:20
• @uhoh Even restricted to the plane, there are still an infinite set of ellipses that share a focus, a designated point on the ellipse's boundary, and a specific nonzero eccentricity value. If you have the semimajor axis as well, you can cut that down to two. Aug 18, 2021 at 16:41
• @uhoh Given $M$, $r$, and $e$, you can only solve for $|\vec{v}|$ if $e=0$. For nonzero $e$, without $a$, there is no way to tell if you are at perihelion or aphelion, or any other part of the elliptical orbit at distance $r$. Aug 18, 2021 at 17:03

As previously answered by Connor Garcia, the answer is "No, mass, eccentricity, and position are not enough to determine orbital velocity, even given a specific orbital plane, unless the eccentricity is zero."

One way to intuitively envision this: There is a continuum of similar elliptical orbits with the specified eccentricity $$e$$, that range in semi-major axis length $$\frac{|\vec{r}|}{1+e} \le a \le \frac{|\vec{r}|}{1-e}$$ and for any one of those, you can always rotate it around the central body is in a position where the point at the end of the radial distance vector is on the boundary of the ellipse.

Orbits of Eccentricity $$e = 0.25$$ that pass through Point P The animation shows the range of orbits the chosen eccentricity in a single plane that pass through a chosen point $$\mathrm{P}$$ at the end of the radial distance vector $$\vec{r}$$, normalized to have a length of 1 unit.

The central body at $$\mathrm{F_1}$$ has Standard Gravitational Parameter $$\mu = 1$$. This allowed the velocity vector $$\vec{v}$$, to be calculated using the Vis-Viva equation, tangent to the ellipse, and displayed in the prograde (counterclockwise) direction, but the retrograde direction of $$-\vec{v}$$ would also be a valid value.

(And if you're asking, no, the shape traced out by the range of velocity vectors is not an ellipse)

And for every semimajor axis $$a$$ such that $$\frac{|\vec{r}|}{1+e} \lt a \lt \frac{|\vec{r}|}{1-e}$$, two congruent orbits in different rotations exist as valid choices, so adding the semimajor axis and orbital direction to the calculation isn't enough to uniquely specify the orbit in a designated plane.

• +1 Your graphic is just awesome. Could you share a bit about how you built it? Aug 21, 2021 at 0:32
• Thanks, @ConnorGarcia It's a GeoGebra Calculator graph that I constructed to animate the scaling and rotating of the ellipse, and used the ExportImage command to export the animation. Never have been able to figure out why it makes the colors flicker like that. Aug 21, 2021 at 1:35

No, this is an underdetermined problem if you don't have the semi-major axis $$a$$ and orbital inclination $$i$$ (or some equivalent).

However, if you want circular orbits, then the semi-major axis $$a$$ is the same as the distance between the bodies.

If you want prograde orbits in the x-y plane then the orbital inclination $$i$$ is 0.

Then you can calculate the velocity vector $$\vec{v}$$ in 2D on the x-y plane with magnitude derived from the vis-viva equation, perpendicular to the vector from the large to the small body, along the same direction as the large body rotation.

• side comment
– uhoh
Aug 18, 2021 at 16:21
• That could be a good solution to my problem; I can calculate the velocity vector for circular orbits and then, add weighted pseudo-random variations to it to make it more "natural". It's worth a try!
– Eol
Aug 18, 2021 at 16:57