Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 2.34 KB

lagrange-point.md

File metadata and controls

30 lines (18 loc) · 2.34 KB

//astronomy/io.github.cosinekitty.astronomy/lagrangePoint

lagrangePoint

fun lagrangePoint(point: Int, time: Time, majorBody: Body, minorBody: Body): StateVector

Calculates one of the 5 Lagrange points for a pair of co-orbiting bodies.

Given a more massive "major" body and a much less massive "minor" body, calculates one of the five Lagrange points in relation to the minor body's orbit around the major body. The parameter point is an integer that selects the Lagrange point as follows:

1 = the Lagrange point between the major body and minor body. 2 = the Lagrange point on the far side of the minor body. 3 = the Lagrange point on the far side of the major body. 4 = the Lagrange point 60 degrees ahead of the minor body's orbital position. 5 = the Lagrange point 60 degrees behind the minor body's orbital position.

The function returns the state vector for the selected Lagrange point in J2000 mean equator coordinates (EQJ), with respect to the center of the major body.

To calculate Sun/Earth Lagrange points, pass in Body.Sun for majorBody and Body.EMB (Earth/Moon barycenter) for minorBody. For Lagrange points of the Sun and any other planet, pass in just that planet (e.g. Body.Jupiter) for minorBody. To calculate Earth/Moon Lagrange points, pass in Body.Earth and Body.Moon for the major and minor bodies respectively.

In some cases, it may be more efficient to call lagrangePointFast, especially when the state vectors have already been calculated, or are needed for some other purpose.

Return

The position and velocity of the selected Lagrange point with respect to the major body's center.

Parameters

point An integer 1..5 that selects which of the Lagrange points to calculate.
time The time for which the Lagrange point is to be calculated.
majorBody The more massive of the co-orbiting bodies: Body.Sun or Body.Earth.
minorBody The less massive of the co-orbiting bodies. See main remarks.