Add v0.20.0 Lagrange point documentation
Reference page (20 IMMUTABLE functions), guide with progressive scenarios (JWST, Trojans, cislunar, planetary moons, Hill survey), 17 DE variant sections appended to functions-de.mdx, sidebar entries.
This commit is contained in:
parent
eefc0958f6
commit
0be3e11247
@ -74,6 +74,7 @@ export default defineConfig({
|
|||||||
{ label: "Building TLE Catalogs", slug: "guides/catalog-management" },
|
{ label: "Building TLE Catalogs", slug: "guides/catalog-management" },
|
||||||
{ label: "Rise/Set Prediction", slug: "guides/rise-set-prediction" },
|
{ label: "Rise/Set Prediction", slug: "guides/rise-set-prediction" },
|
||||||
{ label: "Constellation Identification", slug: "guides/constellation-identification" },
|
{ label: "Constellation Identification", slug: "guides/constellation-identification" },
|
||||||
|
{ label: "Lagrange Equilibrium Points", slug: "guides/lagrange-equilibrium" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -100,6 +101,7 @@ export default defineConfig({
|
|||||||
{ label: "Functions: Transfers", slug: "reference/functions-transfers" },
|
{ label: "Functions: Transfers", slug: "reference/functions-transfers" },
|
||||||
{ label: "Functions: Refraction", slug: "reference/functions-refraction" },
|
{ label: "Functions: Refraction", slug: "reference/functions-refraction" },
|
||||||
{ label: "Functions: Rise/Set & Constellation", slug: "reference/functions-rise-set" },
|
{ label: "Functions: Rise/Set & Constellation", slug: "reference/functions-rise-set" },
|
||||||
|
{ label: "Functions: Lagrange Points", slug: "reference/functions-lagrange" },
|
||||||
{ label: "Functions: DE Ephemeris", slug: "reference/functions-de" },
|
{ label: "Functions: DE Ephemeris", slug: "reference/functions-de" },
|
||||||
{ label: "Functions: Orbit Determination", slug: "reference/functions-od" },
|
{ label: "Functions: Orbit Determination", slug: "reference/functions-od" },
|
||||||
{ label: "Operators & Indexes", slug: "reference/operators-gist" },
|
{ label: "Operators & Indexes", slug: "reference/operators-gist" },
|
||||||
|
|||||||
255
docs/src/content/docs/guides/lagrange-equilibrium.mdx
Normal file
255
docs/src/content/docs/guides/lagrange-equilibrium.mdx
Normal file
@ -0,0 +1,255 @@
|
|||||||
|
---
|
||||||
|
title: Lagrange Equilibrium Points
|
||||||
|
sidebar:
|
||||||
|
order: 15
|
||||||
|
---
|
||||||
|
|
||||||
|
import { Aside } from "@astrojs/starlight/components";
|
||||||
|
|
||||||
|
Lagrange points are the five positions in a two-body gravitational system where a third, much smaller body experiences zero net acceleration in the co-rotating frame. Three of them -- the collinear points L1, L2, L3 -- were identified by Euler in 1767. The remaining two equilateral points L4 and L5 were found by Lagrange in 1772. The physical reality matches the mathematics: SOHO stares at the Sun from Earth-Sun L1, JWST observes from the cold shadow of L2, and several thousand Trojan asteroids share Jupiter's orbit clustered around L4 and L5.
|
||||||
|
|
||||||
|
pg_orrery v0.20.0 adds 37 functions for computing Lagrange point positions across every gravitational system the extension already models: Sun-planet (8 planets, each with 5 L-points), Earth-Moon (5 points), and 19 planetary moons spanning the Galilean, Saturn, Uranus, and Mars families. The solver uses the Circular Restricted Three-Body Problem (CR3BP): Newton-Raphson on the quintic equilibrium polynomial for the collinear points, the classical equilateral geometry for L4/L5, all projected from the co-rotating frame into heliocentric ecliptic J2000 coordinates via the instantaneous orbital geometry.
|
||||||
|
|
||||||
|
Every L-point can be queried as a heliocentric position, a topocentric observation, or an equatorial RA/Dec. Distances from asteroids to any L-point let you identify Trojans in bulk. Hill radii define gravitational spheres of influence. The total is 140 equilibrium positions -- 40 Sun-planet, 5 Earth-Moon, 95 planetary moon -- all accessible with a single function call.
|
||||||
|
|
||||||
|
## How you do it today
|
||||||
|
|
||||||
|
Computing Lagrange point positions requires solving the CR3BP for the specific mass ratio of the system, then projecting from the co-rotating frame into a physical coordinate system:
|
||||||
|
|
||||||
|
- **JPL Horizons**: Supports specific L-points as targets (e.g., `@L2` for Sun-Earth L2). Limited to Sun-planet systems. No planetary moon L-points. Web and email interface, not designed for batch queries.
|
||||||
|
- **Skyfield (Python)**: No built-in Lagrange point support. You can manually compute CR3BP positions, but it requires rolling your own quintic solver and coordinate frame rotation.
|
||||||
|
- **GMAT**: Full CR3BP module for mission design -- computes libration point orbits, manifold transfers, station-keeping budgets. Essential for trajectory design, but overkill for "where is L2 on the sky tonight?"
|
||||||
|
- **STK/Astrogator**: Commercial. Full three-body dynamics with halo orbit families. Not designed for batch surveys across all planets and moon systems.
|
||||||
|
|
||||||
|
For all of these, the workflow is: pick a specific system (usually Sun-Earth), request one L-point at a time, get the result in one coordinate frame. Building a survey across all planets and moon systems requires scripting loops and managing coordinate transforms.
|
||||||
|
|
||||||
|
## What changes with pg_orrery
|
||||||
|
|
||||||
|
Six function families cover the complete Lagrange point problem:
|
||||||
|
|
||||||
|
| Family | Functions | Systems | Use case |
|
||||||
|
|---|---|---|---|
|
||||||
|
| Sun-planet | `lagrange_heliocentric`, `lagrange_observe`, `lagrange_equatorial` | 8 planets x 5 L-points | Where are the Sun-planet equilibrium positions? |
|
||||||
|
| Earth-Moon | `lunar_lagrange_observe`, `lunar_lagrange_equatorial` | 5 L-points | Cislunar equilibrium for Artemis-era planning |
|
||||||
|
| Planetary moons | `galilean_lagrange_*`, `saturn_moon_lagrange_*`, `uranus_moon_lagrange_*`, `mars_moon_lagrange_*` | 19 moons x 5 L-points | Every moon system pg_orrery tracks |
|
||||||
|
| Distance | `lagrange_distance`, `lagrange_distance_oe` | Any Sun-planet L-point | Trojan asteroid identification |
|
||||||
|
| Hill sphere | `hill_radius`, `hill_radius_lunar`, `lagrange_zone_radius` | All systems | Gravitational influence boundaries |
|
||||||
|
| Convenience | `lagrange_mass_ratio`, `lagrange_point_name` | Diagnostic | CR3BP parameters, human-readable labels |
|
||||||
|
|
||||||
|
Body IDs follow the existing conventions: Sun-planet uses 1=Mercury through 8=Neptune, Galilean moons 0-3 (Io-Callisto), Saturn moons 0-7 (Mimas-Hyperion), Uranus moons 0-4 (Miranda-Oberon), Mars moons 0-1 (Phobos-Deimos). Point IDs are 1-5 for L1-L5.
|
||||||
|
|
||||||
|
All IMMUTABLE functions also have DE variants (`_de` suffix) that use JPL DE440/441 positions when configured. See the [DE Ephemeris guide](/guides/de-ephemeris/).
|
||||||
|
|
||||||
|
## What pg_orrery does not replace
|
||||||
|
|
||||||
|
<Aside type="caution" title="CR3BP approximation only">
|
||||||
|
The CR3BP assumes circular orbits for the primaries. Real planetary orbits are elliptical --- Mars has an eccentricity of 0.093. The computed L-point positions are first-order approximations of the instantaneous equilibrium.
|
||||||
|
</Aside>
|
||||||
|
|
||||||
|
- **No station-keeping.** Real spacecraft at L1/L2 require periodic maneuvers to maintain their halo or Lissajous orbits. pg_orrery computes the equilibrium point, not the orbit around it.
|
||||||
|
- **No halo or Lissajous orbits.** JWST doesn't sit at L2 --- it orbits L2 in a halo orbit with a roughly 400,000 km radius. The extension returns the point itself.
|
||||||
|
- **No manifold transfers.** The stable/unstable manifolds of L1/L2 are the backbone of low-energy transfer design. For trajectory optimization, use GMAT or NASA's MONTE.
|
||||||
|
- **No four-body effects.** The three-body approximation breaks down when multiple large bodies interact (e.g., Sun-Jupiter-Saturn near conjunction). The L-point positions are instantaneous geometric solutions.
|
||||||
|
- **No libration orbit families.** The extension computes the static equilibrium point, not the family of periodic orbits around it (Lyapunov, halo, vertical, butterfly).
|
||||||
|
|
||||||
|
For mission design beyond "where is the L-point?", use GMAT with its CR3BP module or MONTE for multi-body dynamics.
|
||||||
|
|
||||||
|
## Try it
|
||||||
|
|
||||||
|
### Where is JWST?
|
||||||
|
|
||||||
|
Sun-Earth L2 sits about 1.5 million km anti-sunward of Earth. JWST has been there since January 2022. The L2 heliocentric distance should be slightly beyond Earth's orbital radius:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Sun-Earth L1 and L2 heliocentric distances
|
||||||
|
SELECT lagrange_point_name(p) AS point,
|
||||||
|
round(helio_distance(lagrange_heliocentric(3, p, '2000-01-01 12:00:00+00'))::numeric, 2) AS sun_dist_au
|
||||||
|
FROM generate_series(1, 2) AS p;
|
||||||
|
```
|
||||||
|
|
||||||
|
L1 is at roughly 0.97 AU (sunward of Earth) and L2 at roughly 0.99 AU (anti-sunward). Both are within about 0.01 AU --- around 1.5 million km --- of Earth's position.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- L2 sky position (always near the anti-solar point)
|
||||||
|
SELECT round(eq_ra(lagrange_equatorial(3, 2, now()))::numeric, 4) AS ra_hours,
|
||||||
|
round(eq_dec(lagrange_equatorial(3, 2, now()))::numeric, 4) AS dec_deg,
|
||||||
|
constellation(lagrange_equatorial(3, 2, now())) AS constellation;
|
||||||
|
```
|
||||||
|
|
||||||
|
Sun-Earth L2 is always approximately 12 hours of RA offset from the Sun. Its constellation changes throughout the year as the Earth orbits.
|
||||||
|
|
||||||
|
### Complete L-point survey for one planet
|
||||||
|
|
||||||
|
Map all five Sun-Earth Lagrange points at once:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT lagrange_point_name(p) AS point,
|
||||||
|
round(helio_distance(lagrange_heliocentric(3, p, now()))::numeric, 4) AS sun_dist_au,
|
||||||
|
round(eq_ra(lagrange_equatorial(3, p, now()))::numeric, 4) AS ra_hours,
|
||||||
|
round(eq_dec(lagrange_equatorial(3, p, now()))::numeric, 4) AS dec_deg,
|
||||||
|
constellation(lagrange_equatorial(3, p, now())) AS constellation
|
||||||
|
FROM generate_series(1, 5) AS p;
|
||||||
|
```
|
||||||
|
|
||||||
|
L4 leads Earth by roughly 60 degrees in its orbit; L5 trails by roughly 60 degrees. L3 is on the opposite side of the Sun. L1 and L2 are close to Earth, straddling it along the Sun-Earth line.
|
||||||
|
|
||||||
|
### L1 distances across the solar system
|
||||||
|
|
||||||
|
The L1 point for each planet lies between the Sun and the planet. Its heliocentric distance scales with the planet's orbital radius:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT body_id,
|
||||||
|
CASE body_id
|
||||||
|
WHEN 1 THEN 'Mercury' WHEN 2 THEN 'Venus' WHEN 3 THEN 'Earth'
|
||||||
|
WHEN 4 THEN 'Mars' WHEN 5 THEN 'Jupiter' WHEN 6 THEN 'Saturn'
|
||||||
|
WHEN 7 THEN 'Uranus' WHEN 8 THEN 'Neptune'
|
||||||
|
END AS planet,
|
||||||
|
round(helio_distance(lagrange_heliocentric(body_id, 1, '2000-01-01 12:00:00+00'))::numeric, 2) AS l1_sun_dist_au
|
||||||
|
FROM generate_series(1, 8) AS body_id
|
||||||
|
ORDER BY body_id;
|
||||||
|
```
|
||||||
|
|
||||||
|
For a reference, verified values at J2000: Mercury 0.46, Venus 0.71, Earth 0.97, Mars 1.38, Jupiter 4.63, Saturn 8.77, Uranus 19.44, Neptune 29.35 AU.
|
||||||
|
|
||||||
|
### Trojan asteroid proximity
|
||||||
|
|
||||||
|
Jupiter's L4 and L5 host the largest known populations of Trojan asteroids. With `lagrange_distance_oe`, you can measure how close an asteroid with known orbital elements is to a Lagrange point:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- (588) Achilles — the first discovered Trojan, near Jupiter L4
|
||||||
|
SELECT round(lagrange_distance_oe(
|
||||||
|
5, 4,
|
||||||
|
oe_from_mpc('00588 14.39 0.15 K249V 41.50128 169.10254 334.19917 13.04512 0.0760428 0.22963720 5.1763803 0 MPO752723 4285 88 1992-2024 0.49 M-v 30h MPCW 0000 (588) Achilles 20240913'),
|
||||||
|
'2024-06-21 12:00:00+00'
|
||||||
|
)::numeric, 2) AS dist_to_l4_au;
|
||||||
|
```
|
||||||
|
|
||||||
|
For a bulk survey, load an MPC catalog into a table and query every asteroid's distance to Jupiter L4 and L5:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Find objects within 1 AU of Jupiter L4 (Trojan candidates)
|
||||||
|
SELECT name,
|
||||||
|
round(lagrange_distance_oe(5, 4, oe, '2024-06-21 12:00:00+00')::numeric, 3) AS dist_au
|
||||||
|
FROM mpc_asteroids
|
||||||
|
WHERE lagrange_distance_oe(5, 4, oe, '2024-06-21 12:00:00+00') < 1.0
|
||||||
|
ORDER BY dist_au
|
||||||
|
LIMIT 20;
|
||||||
|
```
|
||||||
|
|
||||||
|
The `lagrange_distance` function works with raw `heliocentric` positions if you already have them, while `lagrange_distance_oe` accepts `orbital_elements` directly and handles the Keplerian propagation internally.
|
||||||
|
|
||||||
|
### Earth-Moon L1 for cislunar operations
|
||||||
|
|
||||||
|
Earth-Moon L1 sits between the Earth and Moon at roughly 326,000 km from Earth. Artemis Gateway is planned for a near-rectilinear halo orbit around the Moon, but Earth-Moon L1 and L2 are natural waypoints for cislunar logistics:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Earth-Moon L1 distance and sky position
|
||||||
|
SELECT round(eq_distance(lunar_lagrange_equatorial(1, now()))::numeric, 0) AS dist_km,
|
||||||
|
round(eq_ra(lunar_lagrange_equatorial(1, now()))::numeric, 4) AS ra_hours,
|
||||||
|
round(eq_dec(lunar_lagrange_equatorial(1, now()))::numeric, 4) AS dec_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
The distance should fall between 300,000 and 360,000 km, varying with the Moon's orbital eccentricity. The sky position tracks the Moon's motion, offset slightly toward Earth.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- All 5 Earth-Moon L-points from Boulder
|
||||||
|
SELECT lagrange_point_name(p) AS point,
|
||||||
|
round(topo_elevation(lunar_lagrange_observe(p, '40.0N 105.3W 1655m'::observer, now()))::numeric, 2) AS el_deg,
|
||||||
|
round(topo_azimuth(lunar_lagrange_observe(p, '40.0N 105.3W 1655m'::observer, now()))::numeric, 2) AS az_deg
|
||||||
|
FROM generate_series(1, 5) AS p;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Planetary moon Lagrange points
|
||||||
|
|
||||||
|
Every moon system pg_orrery tracks has Lagrange points. The Galilean moons of Jupiter are the most accessible:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Jupiter-Io L4 and L5 (leading and trailing Io by ~60 degrees)
|
||||||
|
SELECT lagrange_point_name(p) AS point,
|
||||||
|
round(eq_ra(galilean_lagrange_equatorial(0, p, now()))::numeric, 4) AS ra_hours,
|
||||||
|
round(eq_dec(galilean_lagrange_equatorial(0, p, now()))::numeric, 4) AS dec_deg
|
||||||
|
FROM generate_series(4, 5) AS p;
|
||||||
|
|
||||||
|
-- Saturn-Titan L1 from Greenwich
|
||||||
|
SELECT round(topo_elevation(saturn_moon_lagrange_observe(5, 1, '51.4769N 0.0005W 0m'::observer, now()))::numeric, 2) AS el_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
Titan is the most massive Saturn moon (GM ratio 4226.5, compared to millions for the icy moons), so its Lagrange points are the most physically significant in the Saturn system. For context, Saturn's Tethys actually has co-orbital companions near its L4 and L5 --- Telesto and Calypso.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- All four Galilean moon families: one L4 each
|
||||||
|
SELECT 'Io' AS moon, round(eq_ra(galilean_lagrange_equatorial(0, 4, now()))::numeric, 4) AS l4_ra
|
||||||
|
UNION ALL
|
||||||
|
SELECT 'Europa', round(eq_ra(galilean_lagrange_equatorial(1, 4, now()))::numeric, 4)
|
||||||
|
UNION ALL
|
||||||
|
SELECT 'Ganymede', round(eq_ra(galilean_lagrange_equatorial(2, 4, now()))::numeric, 4)
|
||||||
|
UNION ALL
|
||||||
|
SELECT 'Callisto', round(eq_ra(galilean_lagrange_equatorial(3, 4, now()))::numeric, 4);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Hill sphere survey
|
||||||
|
|
||||||
|
The Hill radius defines the gravitational sphere of influence for each planet. Inside this radius, the planet's gravity dominates over the Sun's:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT body_id,
|
||||||
|
CASE body_id
|
||||||
|
WHEN 1 THEN 'Mercury' WHEN 2 THEN 'Venus' WHEN 3 THEN 'Earth'
|
||||||
|
WHEN 4 THEN 'Mars' WHEN 5 THEN 'Jupiter' WHEN 6 THEN 'Saturn'
|
||||||
|
WHEN 7 THEN 'Uranus' WHEN 8 THEN 'Neptune'
|
||||||
|
END AS planet,
|
||||||
|
round(hill_radius(body_id, now())::numeric, 4) AS hill_au,
|
||||||
|
round((hill_radius(body_id, now()) * 149597870.7)::numeric, 0) AS hill_km
|
||||||
|
FROM generate_series(1, 8) AS body_id;
|
||||||
|
```
|
||||||
|
|
||||||
|
Jupiter has the largest Hill sphere at roughly 0.35 AU (about 53 million km). Earth's is roughly 0.01 AU (about 1.5 million km) --- L1 and L2 sit right at the Hill sphere boundary, which is not a coincidence: the Hill radius and the L1 distance are both derived from the same cubic approximation of the CR3BP.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Earth-Moon Hill radius (Moon's gravitational influence)
|
||||||
|
SELECT round(hill_radius_lunar(now())::numeric, 6) AS lunar_hill_au,
|
||||||
|
round((hill_radius_lunar(now()) * 149597870.7)::numeric, 0) AS lunar_hill_km;
|
||||||
|
```
|
||||||
|
|
||||||
|
The Moon's Hill radius is much smaller --- roughly 60,000 km. Objects within this radius are gravitationally bound to the Moon rather than the Earth.
|
||||||
|
|
||||||
|
### Libration zone radius
|
||||||
|
|
||||||
|
The `lagrange_zone_radius` function estimates the approximate extent of stable libration around each L-point. The physics differs by point type: L1/L2 zones scale with the Hill radius, L4/L5 zones scale with the square root of the mass ratio (horseshoe/tadpole orbit widths from Dermott 1981), and L3's zone is extremely narrow:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT lagrange_point_name(p) AS point,
|
||||||
|
round(lagrange_zone_radius(5, p, now())::numeric, 4) AS zone_au
|
||||||
|
FROM generate_series(1, 5) AS p;
|
||||||
|
```
|
||||||
|
|
||||||
|
Jupiter's L4/L5 zones are the widest, which explains why they collect so many Trojans. The L3 zone is vanishingly small for all planets.
|
||||||
|
|
||||||
|
### Sanity checks
|
||||||
|
|
||||||
|
Verify the solver produces physically consistent results:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- L-point distance to itself should be exactly zero
|
||||||
|
SELECT round(lagrange_distance(
|
||||||
|
5, 4,
|
||||||
|
lagrange_heliocentric(5, 4, '2000-01-01 12:00:00+00'),
|
||||||
|
'2000-01-01 12:00:00+00'
|
||||||
|
)::numeric, 10) AS self_distance;
|
||||||
|
|
||||||
|
-- L4 and L5 should be equidistant from the Sun (equilateral triangle)
|
||||||
|
SELECT abs(
|
||||||
|
helio_distance(lagrange_heliocentric(5, 4, '2000-01-01 12:00:00+00'))
|
||||||
|
-
|
||||||
|
helio_distance(lagrange_heliocentric(5, 5, '2000-01-01 12:00:00+00'))
|
||||||
|
) < 0.001 AS l4_l5_equidistant;
|
||||||
|
|
||||||
|
-- L1 is always closer to the Sun than L2
|
||||||
|
SELECT helio_distance(lagrange_heliocentric(3, 1, now()))
|
||||||
|
< helio_distance(lagrange_heliocentric(3, 2, now()))
|
||||||
|
AS l1_closer_than_l2;
|
||||||
|
```
|
||||||
|
|
||||||
|
<Aside type="note" title="Error handling">
|
||||||
|
All Lagrange functions validate their inputs. Invalid body IDs (outside 1-8 for Sun-planet, outside the range for each moon family) or invalid point IDs (outside 1-5) raise descriptive errors. DE variants fall back to VSOP87/ELP2000-82B when no DE file is configured --- the results are identical.
|
||||||
|
</Aside>
|
||||||
@ -518,3 +518,505 @@ SELECT (pg_orrery_ephemeris_info()).provider;
|
|||||||
-- Full diagnostic
|
-- Full diagnostic
|
||||||
SELECT * FROM pg_orrery_ephemeris_info();
|
SELECT * FROM pg_orrery_ephemeris_info();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
{/* --- Lagrange Point DE Variants --- */}
|
||||||
|
|
||||||
|
## lagrange_heliocentric_de
|
||||||
|
|
||||||
|
Computes the heliocentric ecliptic J2000 position of a Sun-planet Lagrange point using DE planet positions. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_heliocentric_de(body_id int4, point_id int4, t timestamptz) → heliocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier (1-8, Mercury through Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `heliocentric` position in AU (ecliptic J2000 frame). Identical return type to `lagrange_heliocentric()`.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Compare DE vs VSOP87 for Sun-Earth L1
|
||||||
|
SELECT round(helio_distance(lagrange_heliocentric(3, 1, now()))::numeric, 6) AS vsop87,
|
||||||
|
round(helio_distance(lagrange_heliocentric_de(3, 1, now()))::numeric, 6) AS de;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_observe_de
|
||||||
|
|
||||||
|
Computes the topocentric position of a Sun-planet Lagrange point using DE planet positions. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_observe_de(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier (1-8, Mercury through Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation, range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(topo_elevation(lagrange_observe_de(3, 2, '40.0N 105.3W 1655m'::observer, now()))::numeric, 2) AS el;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_equatorial_de
|
||||||
|
|
||||||
|
Computes the geocentric apparent equatorial coordinates (RA/Dec) of a Sun-planet Lagrange point using DE planet positions. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_equatorial_de(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier (1-8, Mercury through Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km) from Earth's center.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(eq_ra(lagrange_equatorial_de(3, 2, now()))::numeric, 4) AS ra,
|
||||||
|
round(eq_dec(lagrange_equatorial_de(3, 2, now()))::numeric, 4) AS dec;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_distance_de
|
||||||
|
|
||||||
|
Computes the distance in AU between a given heliocentric position and a Sun-planet Lagrange point, using DE planet positions. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_distance_de(body_id int4, point_id int4, pos heliocentric, t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier (1-8, Mercury through Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `pos` | `heliocentric` | Position to measure distance from |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Distance in AU between the given position and the Lagrange point.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(lagrange_distance_de(
|
||||||
|
5, 4,
|
||||||
|
lagrange_heliocentric_de(5, 4, now()),
|
||||||
|
now()
|
||||||
|
)::numeric, 10) AS self_distance;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_distance_oe_de
|
||||||
|
|
||||||
|
Computes the distance in AU between an object described by orbital elements and a Sun-planet Lagrange point, using DE planet positions. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_distance_oe_de(body_id int4, point_id int4, oe orbital_elements, t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier (1-8, Mercury through Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `oe` | `orbital_elements` | Orbital elements of the object |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Distance in AU between the object and the Lagrange point.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Trojan proximity with DE accuracy
|
||||||
|
SELECT round(lagrange_distance_oe_de(5, 4, oe, now())::numeric, 4) AS dist_au
|
||||||
|
FROM mpc_asteroids WHERE name = '(588) Achilles';
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lunar_lagrange_observe_de
|
||||||
|
|
||||||
|
Computes the topocentric position of an Earth-Moon Lagrange point using DE positions. Falls back to ELP2000-82B if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lunar_lagrange_observe_de(point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation, range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(topo_elevation(lunar_lagrange_observe_de(1, '40.0N 105.3W 1655m'::observer, now()))::numeric, 2) AS el;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lunar_lagrange_equatorial_de
|
||||||
|
|
||||||
|
Computes the geocentric apparent equatorial coordinates (RA/Dec) of an Earth-Moon Lagrange point using DE positions. Falls back to ELP2000-82B if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lunar_lagrange_equatorial_de(point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km) from Earth's center.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(eq_distance(lunar_lagrange_equatorial_de(1, now()))::numeric, 0) AS dist_km;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## galilean_lagrange_observe_de
|
||||||
|
|
||||||
|
Computes the topocentric position of a Galilean moon Lagrange point. Uses DE for Jupiter's heliocentric position and L1.2 theory for the moon's offset. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
galilean_lagrange_observe_de(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | 0=Io, 1=Europa, 2=Ganymede, 3=Callisto |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation, range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(topo_elevation(galilean_lagrange_observe_de(0, 4, '40.0N 105.3W 1655m'::observer, now()))::numeric, 2) AS el;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## galilean_lagrange_equatorial_de
|
||||||
|
|
||||||
|
Computes the geocentric equatorial coordinates (RA/Dec) of a Galilean moon Lagrange point. Uses DE for Jupiter's heliocentric position and L1.2 theory for the moon's offset. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
galilean_lagrange_equatorial_de(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | 0=Io, 1=Europa, 2=Ganymede, 3=Callisto |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km) from Earth's center.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(eq_ra(galilean_lagrange_equatorial_de(0, 4, now()))::numeric, 4) AS ra;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## saturn_moon_lagrange_observe_de
|
||||||
|
|
||||||
|
Computes the topocentric position of a Saturn moon Lagrange point. Uses DE for Saturn's heliocentric position and TASS17 theory for the moon's offset. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
saturn_moon_lagrange_observe_de(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | 0=Mimas, 1=Enceladus, 2=Tethys, 3=Dione, 4=Rhea, 5=Titan, 6=Iapetus, 7=Hyperion |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation, range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## saturn_moon_lagrange_equatorial_de
|
||||||
|
|
||||||
|
Computes the geocentric equatorial coordinates (RA/Dec) of a Saturn moon Lagrange point. Uses DE for Saturn's heliocentric position and TASS17 theory for the moon's offset. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
saturn_moon_lagrange_equatorial_de(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | 0=Mimas, 1=Enceladus, 2=Tethys, 3=Dione, 4=Rhea, 5=Titan, 6=Iapetus, 7=Hyperion |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km) from Earth's center.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(eq_ra(saturn_moon_lagrange_equatorial_de(5, 1, now()))::numeric, 4) AS titan_l1_ra;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## uranus_moon_lagrange_observe_de
|
||||||
|
|
||||||
|
Computes the topocentric position of a Uranus moon Lagrange point. Uses DE for Uranus's heliocentric position and GUST86 theory for the moon's offset. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
uranus_moon_lagrange_observe_de(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | 0=Miranda, 1=Ariel, 2=Umbriel, 3=Titania, 4=Oberon |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation, range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## uranus_moon_lagrange_equatorial_de
|
||||||
|
|
||||||
|
Computes the geocentric equatorial coordinates (RA/Dec) of a Uranus moon Lagrange point. Uses DE for Uranus's heliocentric position and GUST86 theory for the moon's offset. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
uranus_moon_lagrange_equatorial_de(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | 0=Miranda, 1=Ariel, 2=Umbriel, 3=Titania, 4=Oberon |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km) from Earth's center.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## mars_moon_lagrange_observe_de
|
||||||
|
|
||||||
|
Computes the topocentric position of a Mars moon Lagrange point. Uses DE for Mars's heliocentric position and MarsSat theory for the moon's offset. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
mars_moon_lagrange_observe_de(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | 0=Phobos, 1=Deimos |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation, range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## mars_moon_lagrange_equatorial_de
|
||||||
|
|
||||||
|
Computes the geocentric equatorial coordinates (RA/Dec) of a Mars moon Lagrange point. Uses DE for Mars's heliocentric position and MarsSat theory for the moon's offset. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
mars_moon_lagrange_equatorial_de(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | 0=Phobos, 1=Deimos |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km) from Earth's center.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(eq_ra(mars_moon_lagrange_equatorial_de(0, 4, now()))::numeric, 4) AS phobos_l4_ra;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## hill_radius_de
|
||||||
|
|
||||||
|
Computes the Hill sphere radius in AU for a planet using DE ephemeris for the instantaneous heliocentric distance. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
hill_radius_de(body_id int4, t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier (1-8, Mercury through Neptune) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Hill sphere radius in AU.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(hill_radius_de(5, now())::numeric, 4) AS jupiter_hill_de;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_zone_radius_de
|
||||||
|
|
||||||
|
Computes the effective zone radius around a Lagrange point using DE ephemeris for the planet's instantaneous heliocentric distance. Falls back to VSOP87 if DE is unavailable.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_zone_radius_de(body_id int4, point_id int4, t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier (1-8, Mercury through Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point (1-5, L1 through L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Zone radius in AU.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT round(lagrange_zone_radius_de(5, 4, now())::numeric, 4) AS jup_l4_zone_de;
|
||||||
|
```
|
||||||
680
docs/src/content/docs/reference/functions-lagrange.mdx
Normal file
680
docs/src/content/docs/reference/functions-lagrange.mdx
Normal file
@ -0,0 +1,680 @@
|
|||||||
|
---
|
||||||
|
title: "Functions: Lagrange Points"
|
||||||
|
sidebar:
|
||||||
|
order: 9
|
||||||
|
---
|
||||||
|
|
||||||
|
import { Aside } from "@astrojs/starlight/components";
|
||||||
|
|
||||||
|
Functions for computing Lagrange point equilibrium positions in the Circular Restricted Three-Body Problem (CR3BP). Lagrange points are the five positions where a small body can maintain a stable (or quasi-stable) position relative to two larger bodies. L1, L2, and L3 are collinear (unstable), while L4 and L5 form equilateral triangles with the two primaries (stable for mass ratios below the Routh critical value). All functions in this section are `IMMUTABLE STRICT PARALLEL SAFE`.
|
||||||
|
|
||||||
|
<Aside type="tip">
|
||||||
|
`point_id` values: 1=L1, 2=L2, 3=L3, 4=L4, 5=L5. Use `lagrange_point_name(point_id)` to get the human-readable label. See [Body ID Reference](/reference/body-ids/) for planet and moon `body_id` values.
|
||||||
|
</Aside>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_heliocentric
|
||||||
|
|
||||||
|
Heliocentric ecliptic J2000 position of a Sun-planet Lagrange point. The CR3BP quintic solver finds the equilibrium position in the co-rotating frame, which is then rotated into the inertial ecliptic frame using VSOP87 planetary positions.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_heliocentric(body_id int4, point_id int4, t timestamptz) → heliocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier: 1=Mercury, 2=Venus, 3=Earth, 4=Mars, 5=Jupiter, 6=Saturn, 7=Uranus, 8=Neptune |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1=L1, 2=L2, 3=L3, 4=L4, 5=L5 |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `heliocentric` position in AU (ecliptic J2000 frame).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Sun-Earth L1: SOHO lives here (~0.97 AU from Sun)
|
||||||
|
SELECT round(helio_distance(lagrange_heliocentric(3, 1, '2000-01-01 12:00:00+00'))::numeric, 2) AS sun_dist_au;
|
||||||
|
-- -> 0.97
|
||||||
|
```
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- All planets' L1 distances from the Sun
|
||||||
|
SELECT body_id,
|
||||||
|
round(helio_distance(lagrange_heliocentric(body_id, 1, '2000-01-01 12:00:00+00'))::numeric, 4) AS l1_dist_au
|
||||||
|
FROM generate_series(1, 8) AS body_id;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_observe
|
||||||
|
|
||||||
|
Observe a Sun-planet Lagrange point from a ground station. Computes the heliocentric Lagrange position, subtracts Earth's geocentric position, and transforms to topocentric azimuth/elevation.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_observe(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier: 1-8 (Mercury-Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation (degrees), range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Where is the Sun-Earth L2 (JWST's home) from Greenwich?
|
||||||
|
SELECT round(topo_azimuth(t)::numeric, 2) AS az,
|
||||||
|
round(topo_elevation(t)::numeric, 2) AS el
|
||||||
|
FROM lagrange_observe(3, 2, '51.4769N 0.0005W 0m'::observer, now()) AS t;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_equatorial
|
||||||
|
|
||||||
|
Geocentric RA/Dec of a Sun-planet Lagrange point. Converts the heliocentric ecliptic position to geocentric equatorial coordinates, precessed to the date of observation.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_equatorial(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier: 1-8 (Mercury-Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Sun-Earth L2 sky position (near the anti-solar point)
|
||||||
|
SELECT round(eq_ra(lagrange_equatorial(3, 2, now()))::numeric, 4) AS ra_hours,
|
||||||
|
round(eq_dec(lagrange_equatorial(3, 2, now()))::numeric, 4) AS dec_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_distance
|
||||||
|
|
||||||
|
Distance (AU) from a heliocentric position to a Sun-planet Lagrange point. Computes the Lagrange point position at the given time and returns the Euclidean distance.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_distance(body_id int4, point_id int4, pos heliocentric, t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier: 1-8 (Mercury-Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `pos` | `heliocentric` | Heliocentric position to measure from |
|
||||||
|
| `t` | `timestamptz` | Evaluation time (determines the Lagrange point position) |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Distance in AU from the given position to the Lagrange point.
|
||||||
|
|
||||||
|
<Aside type="caution">
|
||||||
|
This function measures the distance from *any* heliocentric position to a Lagrange point. Useful for identifying Trojan asteroids near L4/L5 or objects temporarily captured near L1/L2.
|
||||||
|
</Aside>
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Self-test: distance from Jupiter L4 to itself
|
||||||
|
SELECT round(lagrange_distance(
|
||||||
|
5, 4,
|
||||||
|
lagrange_heliocentric(5, 4, '2000-01-01 12:00:00+00'),
|
||||||
|
'2000-01-01 12:00:00+00'
|
||||||
|
)::numeric, 10) AS self_distance;
|
||||||
|
-- -> 0.0000000000
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_distance_oe
|
||||||
|
|
||||||
|
Distance (AU) from an asteroid or comet (specified by `orbital_elements`) to a Sun-planet Lagrange point. Propagates the small body's orbit to the given time via Keplerian mechanics, then measures the distance to the computed Lagrange position.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_distance_oe(body_id int4, point_id int4, oe orbital_elements, t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier: 1-8 (Mercury-Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `oe` | `orbital_elements` | Orbital elements for the asteroid or comet |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Distance in AU.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Check if (588) Achilles is near Jupiter's L4 (Trojan territory)
|
||||||
|
SELECT round(lagrange_distance_oe(
|
||||||
|
5, 4,
|
||||||
|
oe_from_mpc('00588 14.39 0.15 K249V 41.50128 169.10254 334.19917 13.04512 0.0760428 0.22963720 5.1763803 0 MPO752723 4285 88 1992-2024 0.49 M-v 30h MPCW 0000 (588) Achilles 20240913'),
|
||||||
|
'2024-06-21 12:00:00+00'
|
||||||
|
)::numeric, 4) AS dist_au;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lunar_lagrange_observe
|
||||||
|
|
||||||
|
Observe an Earth-Moon Lagrange point from a ground station. The Earth-Moon system is implied --- no `body_id` is needed. The Moon's position is computed via ELP2000-82B.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lunar_lagrange_observe(point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation (degrees), range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Earth-Moon L1 from Boulder (Artemis Gateway territory)
|
||||||
|
SELECT round(topo_elevation(lunar_lagrange_observe(1, '40.0N 105.3W 1655m'::observer, now()))::numeric, 2) AS el_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lunar_lagrange_equatorial
|
||||||
|
|
||||||
|
Geocentric RA/Dec of an Earth-Moon Lagrange point. The L1 point lies between Earth and Moon at roughly 84% of the Earth-Moon distance.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lunar_lagrange_equatorial(point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Earth-Moon L1 distance (~326,000 km from Earth)
|
||||||
|
SELECT round(eq_distance(lunar_lagrange_equatorial(1, '2000-01-01 12:00:00+00'))::numeric, 0) AS dist_km;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## galilean_lagrange_observe
|
||||||
|
|
||||||
|
Observe a Jupiter-Galilean moon Lagrange point from a ground station. Uses L1.2 theory (Lieske 1998) for the Galilean moon position and VSOP87 for Jupiter's heliocentric position.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
galilean_lagrange_observe(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Galilean moon: 0=Io, 1=Europa, 2=Ganymede, 3=Callisto |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation (degrees), range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Jupiter-Ganymede L3 from Greenwich
|
||||||
|
SELECT round(topo_elevation(galilean_lagrange_observe(2, 3, '51.4769N 0.0005W 0m'::observer, now()))::numeric, 2) AS el_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## galilean_lagrange_equatorial
|
||||||
|
|
||||||
|
Geocentric RA/Dec of a Jupiter-Galilean moon Lagrange point.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
galilean_lagrange_equatorial(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Galilean moon: 0=Io, 1=Europa, 2=Ganymede, 3=Callisto |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Jupiter-Io L4 sky position
|
||||||
|
SELECT round(eq_ra(galilean_lagrange_equatorial(0, 4, now()))::numeric, 4) AS ra_hours,
|
||||||
|
round(eq_dec(galilean_lagrange_equatorial(0, 4, now()))::numeric, 4) AS dec_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## saturn_moon_lagrange_observe
|
||||||
|
|
||||||
|
Observe a Saturn moon Lagrange point from a ground station. Uses TASS17 theory (Vienne & Duriez 1995) for the moon position and VSOP87 for Saturn's heliocentric position.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
saturn_moon_lagrange_observe(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Saturn moon: 0=Mimas, 1=Enceladus, 2=Tethys, 3=Dione, 4=Rhea, 5=Titan, 6=Iapetus, 7=Hyperion |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation (degrees), range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Saturn-Titan L1 from Boulder
|
||||||
|
SELECT round(topo_azimuth(t)::numeric, 2) AS az,
|
||||||
|
round(topo_elevation(t)::numeric, 2) AS el
|
||||||
|
FROM saturn_moon_lagrange_observe(5, 1, '40.0N 105.3W 1655m'::observer, now()) AS t;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## saturn_moon_lagrange_equatorial
|
||||||
|
|
||||||
|
Geocentric RA/Dec of a Saturn moon Lagrange point.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
saturn_moon_lagrange_equatorial(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Saturn moon: 0=Mimas, 1=Enceladus, 2=Tethys, 3=Dione, 4=Rhea, 5=Titan, 6=Iapetus, 7=Hyperion |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Saturn-Titan L1 sky position
|
||||||
|
SELECT round(eq_ra(saturn_moon_lagrange_equatorial(5, 1, now()))::numeric, 4) AS ra_hours;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## uranus_moon_lagrange_observe
|
||||||
|
|
||||||
|
Observe a Uranus moon Lagrange point from a ground station. Uses GUST86 theory (Laskar & Jacobson 1987) for the moon position and VSOP87 for Uranus's heliocentric position.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
uranus_moon_lagrange_observe(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Uranus moon: 0=Miranda, 1=Ariel, 2=Umbriel, 3=Titania, 4=Oberon |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation (degrees), range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Uranus-Titania L2 from Greenwich
|
||||||
|
SELECT round(topo_elevation(uranus_moon_lagrange_observe(3, 2, '51.4769N 0.0005W 0m'::observer, now()))::numeric, 2) AS el_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## uranus_moon_lagrange_equatorial
|
||||||
|
|
||||||
|
Geocentric RA/Dec of a Uranus moon Lagrange point.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
uranus_moon_lagrange_equatorial(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Uranus moon: 0=Miranda, 1=Ariel, 2=Umbriel, 3=Titania, 4=Oberon |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Uranus-Oberon L4 sky position
|
||||||
|
SELECT round(eq_ra(uranus_moon_lagrange_equatorial(4, 4, now()))::numeric, 4) AS ra_hours,
|
||||||
|
round(eq_dec(uranus_moon_lagrange_equatorial(4, 4, now()))::numeric, 4) AS dec_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## mars_moon_lagrange_observe
|
||||||
|
|
||||||
|
Observe a Mars moon Lagrange point from a ground station. Uses MarsSat theory (Jacobson 2014) for the moon position and VSOP87 for Mars's heliocentric position.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
mars_moon_lagrange_observe(body_id int4, point_id int4, obs observer, t timestamptz) → topocentric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Mars moon: 0=Phobos, 1=Deimos |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `obs` | `observer` | Observer location on Earth |
|
||||||
|
| `t` | `timestamptz` | Observation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
A `topocentric` with azimuth, elevation (degrees), range (km), and range rate (km/s).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Mars-Phobos L1 from Boulder
|
||||||
|
SELECT round(topo_azimuth(t)::numeric, 2) AS az,
|
||||||
|
round(topo_elevation(t)::numeric, 2) AS el
|
||||||
|
FROM mars_moon_lagrange_observe(0, 1, '40.0N 105.3W 1655m'::observer, now()) AS t;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## mars_moon_lagrange_equatorial
|
||||||
|
|
||||||
|
Geocentric RA/Dec of a Mars moon Lagrange point.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
mars_moon_lagrange_equatorial(body_id int4, point_id int4, t timestamptz) → equatorial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Mars moon: 0=Phobos, 1=Deimos |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
An `equatorial` with RA (hours), Dec (degrees), and distance (km).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Mars-Deimos L5 sky position
|
||||||
|
SELECT round(eq_ra(mars_moon_lagrange_equatorial(1, 5, now()))::numeric, 4) AS ra_hours,
|
||||||
|
round(eq_dec(mars_moon_lagrange_equatorial(1, 5, now()))::numeric, 4) AS dec_deg;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## hill_radius
|
||||||
|
|
||||||
|
Hill sphere radius (AU) for a Sun-planet system. The Hill sphere is the region where a planet's gravity dominates over the Sun's --- objects beyond this radius are more strongly influenced by the Sun. Computed as r_H = a * (m_p / (3 * m_sun))^(1/3), where a is the instantaneous Sun-planet distance from VSOP87.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
hill_radius(body_id int4, t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier: 1-8 (Mercury-Neptune) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Hill sphere radius in AU.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Jupiter's Hill sphere (~0.35 AU)
|
||||||
|
SELECT round(hill_radius(5, '2000-01-01 12:00:00+00')::numeric, 3) AS jupiter_hill_au;
|
||||||
|
```
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- All planets
|
||||||
|
SELECT body_id,
|
||||||
|
round(hill_radius(body_id, '2000-01-01 12:00:00+00')::numeric, 4) AS hill_au
|
||||||
|
FROM generate_series(1, 8) AS body_id;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## hill_radius_lunar
|
||||||
|
|
||||||
|
Hill sphere radius (AU) for the Earth-Moon system. Much smaller than planetary Hill spheres since the Moon is far less massive relative to Earth than planets are relative to the Sun.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
hill_radius_lunar(t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Hill sphere radius in AU.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT hill_radius_lunar('2000-01-01 12:00:00+00') AS lunar_hill_au;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_zone_radius
|
||||||
|
|
||||||
|
Approximate libration zone radius (AU) around a Sun-planet Lagrange point. For L4/L5, this is related to the tadpole/horseshoe orbit domain where Trojan asteroids can remain trapped. For collinear points (L1/L2/L3), it is the linearized stability boundary.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_zone_radius(body_id int4, point_id int4, t timestamptz) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier: 1-8 (Mercury-Neptune) |
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 (L1-L5) |
|
||||||
|
| `t` | `timestamptz` | Evaluation time |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Zone radius in AU.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Jupiter L4 libration zone (Trojan swarm extent)
|
||||||
|
SELECT round(lagrange_zone_radius(5, 4, '2000-01-01 12:00:00+00')::numeric, 4) AS zone_au;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_mass_ratio
|
||||||
|
|
||||||
|
CR3BP mass parameter mu = M_planet / (M_sun + M_planet). A diagnostic function useful for verifying the CR3BP solver or understanding the relative gravitational influence of a planet in its system.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_mass_ratio(body_id int4) → float8
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `body_id` | `int4` | Planet identifier: 1-8 (Mercury-Neptune) |
|
||||||
|
|
||||||
|
<Aside type="note">
|
||||||
|
No timestamp parameter --- mass ratios are compiled-in constants derived from IAU standard gravitational parameters.
|
||||||
|
</Aside>
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Dimensionless mass ratio (small positive number; Jupiter is ~0.001, Earth is ~0.000003).
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT lagrange_mass_ratio(5) AS jupiter_mu,
|
||||||
|
lagrange_mass_ratio(3) AS earth_mu;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## lagrange_point_name
|
||||||
|
|
||||||
|
Human-readable name for a Lagrange point ID. A simple lookup that converts integer IDs to their standard labels.
|
||||||
|
|
||||||
|
### Signature
|
||||||
|
|
||||||
|
```sql
|
||||||
|
lagrange_point_name(point_id int4) → text
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
|-----------|------|-------------|
|
||||||
|
| `point_id` | `int4` | Lagrange point: 1-5 |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
Text label: `'L1'`, `'L2'`, `'L3'`, `'L4'`, or `'L5'`.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT lagrange_point_name(1) AS name;
|
||||||
|
-- -> 'L1'
|
||||||
|
```
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Use in a query for readable output
|
||||||
|
SELECT lagrange_point_name(p) AS point,
|
||||||
|
round(helio_distance(lagrange_heliocentric(3, p, now()))::numeric, 4) AS sun_dist_au
|
||||||
|
FROM generate_series(1, 5) AS p;
|
||||||
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user