<p>As previously answered by Connor Garcia, the answer is &quot;No, mass, eccentricity, and position are not enough to determine orbital velocity, even given a specific orbital plane, unless the eccentricity is zero.&quot;</p>
<p>One way to intuitively envision this: There is a continuum of similar elliptical orbits with the specified eccentricity <span class="math-container">$e$</span>, that range in semi-major axis length  <span class="math-container">$\frac{|\vec{r}|}{1+e} \le a \le \frac{|\vec{r}|}{1-e}$</span>  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.</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: center;"><strong>Orbits of Eccentricity <span class="math-container">$e = 0.25$</span> that pass through Point P</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;"><a href="https://i.sstatic.net/w1z1h.gif" rel="noreferrer"><img src="https://i.sstatic.net/w1z1h.gif" alt="Orbits of Eccentricity 0.25 that pass through Point P" /></a></td>
</tr>
</tbody>
</table>
</div>
<p>The animation shows the range of orbits the chosen eccentricity in a single plane that pass through a chosen point <span class="math-container">$\mathrm{P}$</span> at the end of the radial distance vector <span class="math-container">$\vec{r}$</span>, normalized to have a length of 1 unit.</p>
<p>The central body at <span class="math-container">$\mathrm{F_1}$</span> has Standard Gravitational Parameter <span class="math-container">$\mu = 1$</span>. This allowed the velocity vector <span class="math-container">$\vec{v}$</span>, to be calculated using the Vis-Viva equation, tangent to the ellipse, and displayed in the prograde (counterclockwise) direction, but the retrograde direction of <span class="math-container">$-\vec{v}$</span> would also be a valid value.</p>
<p>(And if you're asking, no, the shape traced out by the range of velocity vectors is not an ellipse)</p>
<p>And for every semimajor axis <span class="math-container">$a$</span> such that <span class="math-container">$\frac{|\vec{r}|}{1+e} \lt a \lt \frac{|\vec{r}|}{1-e}$</span>, 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.</p>

CC BY-SA 4.0
2021-08-21T00:32:23.940Z
+1 Your graphic is just awesome.  Could you share a bit about how you built it?
Connor Garcia
CC BY-SA 4.0
2021-08-21T01:35:01.420Z
Thanks, @ConnorGarcia  It's a [GeoGebra Calculator graph](https://www.geogebra.org/m/pyq6yc77)  that I constructed to animate the scaling and rotating of the ellipse, and used the [ExportImage](https://wiki.geogebra.org/en/ExportImage_Command) command to export the animation. Never have been able to figure out why it makes the colors flicker like that.
notovny
CC BY-SA 4.0
2021-08-20T23:58:33.317Z
2021-08-21T00:26:18.683Z
2021-08-21T00:26:18.683Z
notovny
<p>No, this is an underdetermined problem if you don't have the semi-major axis <span class="math-container">$a$</span> and orbital inclination <span class="math-container">$i$</span> (or some equivalent).</p>
<p>However, if you want circular orbits, then the semi-major axis <span class="math-container">$a$</span> is the same as the distance between the bodies.</p>
<p>If you want prograde orbits in the x-y plane then the orbital inclination <span class="math-container">$i$</span> is 0.</p>
<p>Then you can calculate the velocity vector <span class="math-container">$\vec{v}$</span> 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.</p>

CC BY-SA 4.0
2021-08-18T16:21:19.303Z
[side comment](https://astronomy.stackexchange.com/questions/45379/given-mass-position-and-eccentricity-is-there-a-way-to-get-initial-velocity-in#comment99206_45379)
uhoh
CC BY-SA 4.0
2021-08-18T16:57:59.133Z
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
CC BY-SA 4.0
2021-08-18T15:47:54.417Z
2021-08-18T15:47:54.417Z
Connor Garcia
<p>I know that the we can get the eccentricity vector  like that: <span class="math-container">$\mathbf{e} = \frac{\mathbf{v} \times \mathbf{h}}{\mu} - \frac{\mathbf{r}}{\|\mathbf{r}\|}$</span> (source: <a href="https://astronomy.stackexchange.com/a/29008/42546">https://astronomy.stackexchange.com/a/29008/42546</a> ).</p>
<p>I would like to know if there's a way to get one of the initial velocity vectors <span class="math-container">$\mathbf{v}$</span> (I believe there's 2) of the lightest of the bodies, given the mass, the position <span class="math-container">$\mathbf{r}$</span> and the eccentricity (not the vector) in a 2-body problem ?</p>
<p>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.</p>
<p>Thank you !</p>

CC BY-SA 4.0
2021-08-18T15:21:36.433Z
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.
notovny
CC BY-SA 4.0
2021-08-18T15:38:31.990Z
No, you cannot because with only mass, position, and eccentricity you don't know the orbital plane.
David Hammen
CC BY-SA 4.0
2021-08-18T16:20:51.397Z
@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
CC BY-SA 4.0
2021-08-18T16:41:23.920Z
@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.
notovny
CC BY-SA 4.0
2021-08-18T17:03:06.993Z
@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$.
Connor Garcia
CC BY-SA 4.0
2021-08-18T17:31:19.197Z
I may have badly expressed my problem here; I want to procedurally forge the orbit, maybe there's data I could add to the generator so that it creates a good orbit? E.g., I can state that the generated body's initial position is equal to its apogee (or perigee) if that helps.
I can create a new question if this becomes too off topic for this one
Eol
CC BY-SA 4.0
2021-08-19T00:12:09.703Z
@ConnorGarcia Yes without $a$ you have the potential energy but not kinetic energy so the orbit could be anything. I don't know why it was so hard for me to reach that point, seems obvious in hindsight.
uhoh
CC BY-SA 4.0
2021-08-19T00:18:24.867Z
@Eol "get initial velocity" sounds like you are asking to "solve for initial velocity" i.e. find the correct answer. Now I'm starting to understand that your "planetary system procedural generator" will probably use a random number generator to build arbitrary systems. So "choose an initial velocity" would have been a very different question. In fact it's a much more interesting question. Usually once an answer is posted we don't substantially revise a question, since we can ask as many as we like, asking a new question based on results/discussion here is the simplest way to go.
uhoh
CC BY-SA 4.0
2021-08-19T00:22:53.057Z
@Eol You can link back here just explaining that the problem is underspecified without some additional choices, so you'd like a reasonable way to select parameters at random. Of course "reasonable" is a hard one, some configurations may be obviously unstable; e.g. an elliptical orbit of a small planet that crosses the path of a big one like Jupiter would rapidly be perturbed to something else. So you might ask about how to distribute all the Kelplerian orbital elements in a rudimentarily quasi-reasonable way.  This is interesting 1) because there are some principles answers can draw from.
uhoh
CC BY-SA 4.0
2021-08-19T00:29:26.063Z
@Eol for example the system will tend to a well defined ecliptic; most bodies would tend to have similar but not identical orbital planes, if there are several planets the would tend to low eccentricities because high values would lead to rapid changes due to interactions, and 2) because there is probably a body of work on modeling exoplanetary systems already; there could be papers on how this is done. You wouldn't necessarily need to be as rigorous because your goal is not necessarily predicting reality, you just want to include some basic aspects of realism *for your procedural generator.*
uhoh
CC BY-SA 4.0
2021-08-19T08:21:20.387Z
Interesting points to concider! If we stick to the 2-body problem in a 2D environment, I may have found the perfect solution thanks to Connor Garcia's answers and the vis-viva equation. I'll edit the question to add precisions to my problem and add my answer some time later.
Eol
<orbit><n-body-simulations>
Given mass, position and eccentricity, is there a way to get initial velocity in a 2-body problem?
Eol
# Given mass, position and eccentricity, is there a way to get initial velocity in a 2-body problem?

(Asked by: username_0 on 2021-08-18)

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 !

**Tags:** orbit, n-body-simulations
> **Comments:**
> **username_1**: 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.  
> **username_2**: No, you cannot because with only mass, position, and eccentricity you don't know the orbital plane.  
> **username_3**: @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.  
> **username_1**: @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.  
> **username_4**: @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$.  
> **username_0**: I may have badly expressed my problem here; I want to procedurally forge the orbit, maybe there's data I could add to the generator so that it creates a good orbit? E.g., I can state that the generated body's initial position is equal to its apogee (or perigee) if that helps. I can create a new question if this becomes too off topic for this one  
> **username_3**: @ConnorGarcia Yes without $a$ you have the potential energy but not kinetic energy so the orbit could be anything. I don't know why it was so hard for me to reach that point, seems obvious in hindsight.  
> **username_3**: @Eol "get initial velocity" sounds like you are asking to "solve for initial velocity" i.e. find the correct answer. Now I'm starting to understand that your "planetary system procedural generator" will probably use a random number generator to build arbitrary systems. So "choose an initial velocity" would have been a very different question. In fact it's a much more interesting question. Usually once an answer is posted we don't substantially revise a question, since we can ask as many as we like, asking a new question based on results/discussion here is the simplest way to go.  
> **username_3**: @Eol You can link back here just explaining that the problem is underspecified without some additional choices, so you'd like a reasonable way to select parameters at random. Of course "reasonable" is a hard one, some configurations may be obviously unstable; e.g. an elliptical orbit of a small planet that crosses the path of a big one like Jupiter would rapidly be perturbed to something else. So you might ask about how to distribute all the Kelplerian orbital elements in a rudimentarily quasi-reasonable way.  This is interesting 1) because there are some principles answers can draw from.  
> **username_3**: @Eol for example the system will tend to a well defined ecliptic; most bodies would tend to have similar but not identical orbital planes, if there are several planets the would tend to low eccentricities because high values would lead to rapid changes due to interactions, and 2) because there is probably a body of work on modeling exoplanetary systems already; there could be papers on how this is done. You wouldn't necessarily need to be as rigorous because your goal is not necessarily predicting reality, you just want to include some basic aspects of realism *for your procedural generator.*  
> **username_0**: Interesting points to concider! If we stick to the 2-body problem in a 2D environment, I may have found the perfect solution thanks to Connor Garcia's answers and the vis-viva equation. I'll edit the question to add precisions to my problem and add my answer some time later.  

---

## 2 answers

### Answer by username_4 on 2021-08-18. Score: 5 | Accepted answer

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.

> **Comments:**
> **username_3**: [side comment](https://astronomy.stackexchange.com/questions/45379/given-mass-position-and-eccentricity-is-there-a-way-to-get-initial-velocity-in#comment99206_45379)  
> **username_0**: 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!  

---

### Answer by username_1 on 2021-08-20. Score: 6

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** |
| --- |
| [Orbits of Eccentricity 0.25 that pass through Point P](https://i.sstatic.net/w1z1h.gif) |

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.

> **Comments:**
> **username_4**: +1 Your graphic is just awesome.  Could you share a bit about how you built it?  
> **username_1**: Thanks, @ConnorGarcia  It's a [GeoGebra Calculator graph](https://www.geogebra.org/m/pyq6yc77)  that I constructed to animate the scaling and rotating of the ellipse, and used the [ExportImage](https://wiki.geogebra.org/en/ExportImage_Command) command to export the animation. Never have been able to figure out why it makes the colors flicker like that.  

---

