# How to get the longitude of the perihelion to find the Heliocentric Equatorial coordinates of a planet

I'm writing a program to randomly generate star systems and I have been having a difficult time figuring this out. I've found the equations I need to get the heliocentric equatorial coordinates, but I haven't been able to figure out how to determine the longitude of perihelion. Is it just the opposite of the longitude of the ascending node or is it a completely different variable?

It might just me, but the names for this stuff is definitely making it more confusing than it should be.

Here is all my notes:

** = power

P = planet's period

a = semi-major axis

b = semi-minor axis

M = mean anomaly

E = Eccentric anomaly

e = eccentricity of orbit

v = true anomaly

A = longitude of asending node

w = longitude of perihelion

i = inclination

t = time

(r, v) = polar coordinates

(x, y, z) = Heliocentric Ecliptic coordinates

(X, Y, Z) = Heliocentric Equalorial coordinates

eccentricity

e = sqrt(1 - (b ** 2 / a ** 2))

Period

P = sqrt(a ** 3)

Kepler's Equation

M = E - e * sin(E)

Mean Anomaly use as starting point for eccentric anomaly

M = (2 * pi * t) / P

True Anomaly

v = 2 * atan(sqrt((1 + e) / (1 - e)) * tan(E / 2))

r = (a(1 - e ** 2)) / (1 + e * cos(v))

Heliocentric Ecliptic coordinates

x = r(cos(A) * cos(w + v) - sin(A) * sin(w + v) * cos(i)

y = r(sin(A) * cos(w + v) + cos(A) * sin(w + v) * cos(i)

z = r * sin(w + v) * sin(i)

Heliocentric Equalorial coordinates

X = x

Y = y * cos(i) - z * sin(i)

Z = y * sin(i) + z * cos(i)

• The longitude of the perihelion is an independent variable. It's not dependent on the longitude of the ascending node, or the other variables that define an ellipse. – user21 Dec 11 '15 at 2:33
• Ok but what is it? – Eegxeta Dec 11 '15 at 15:04
• Since you're creating the star system, you can make it whatever you want it to be. – user21 Dec 11 '15 at 16:28
• Right but I don't know what it is. Does it affect the orientation of the orbit? What units is it in? I kinda need to know what it is as it has enough significance to be in the equations. – Eegxeta Dec 11 '15 at 17:27
• The diagram on en.wikipedia.org/wiki/Longitude_of_the_ascending_node may help explain the relationship between the various elliptical orbit parameters (periapsis in that diagram is perihelion if the central object is the Sun) – user21 Dec 11 '15 at 17:32

As opposed to what @user21 said, the longitude of periastron does depend on the longitude of ascending node (I was surprised by that myself).

In orbital dynamics, there exist the argument of periastron (symbol ω) as well as the longitude of periastron (symbol π [or ϖ but may lead to confusion) ), which is equal to the argument of periastron (ω) plus the longitude of ascending node (Ω). In other words:

π = ω + Ω

Now, the argument of periastron is equal to:

ω = arccos $$\frac{\mathbf{n}\ ·\ \mathbf{e}} {|\mathbf{n}||\mathbf{e}|}$$

If ez < 0 then ω → 2π − ω.

where:

$$\mathbf{n}$$ is a vector pointing towards the ascending node (i.e. the z-component of $$\mathbf{n}$$ is zero), and

$$\mathbf{e}$$ is the eccentricity vector (a vector pointing towards the periastron).

This formula can be found at https://en.wikipedia.org/wiki/Argument_of_periapsis (I call it instead the “argument of periastron,” as Meeus says: “The word ‘periapse’, used by some authors, is incorrect. The word perihelion means the point of the orbit that is closest to the Sun [from the Greek peri = near + helios = Sun]. Similarly, perigee is the point closest to the Earth [ge = Earth]. Therefore, ‘periapse’ would really mean the point closest to the apse; but this is ridiculous, because what is meant is the apse itself!”)

So, using the above formula, you should be able to figure out the longitude of the ascending node for each of your hypothetical bodies.

Have fun!

• Note that the equation π = ω + Ω represents a compound angle; If the Orbital Plane has non-zero Orbital Inclination, you cannot just add the values of the Longitude of the Ascending Node and the Argument of Periapsis to get the Longitude of Periapsis; you're going to have to do some more complicated spherical trigonometry. – notovny Nov 24 '20 at 21:33
• It may be a compound angle, but that’s the definition of “longitude of periastron,” as can be seen here en.wikipedia.org/wiki/Longitude_of_the_periapsis and in any and all other references on the subject you may find. – Pierre Paquette Nov 25 '20 at 1:39