Lambert solver¶
Source: AI/Tools/LambertTools.cs
Solve Lambert's problem: given a departure state and an arrival state (with their epochs), compute the transfer-orbit velocities and the Δv at each endpoint for a two-impulse transfer.
SolveLambert¶
| Parameter | Type | Description |
|---|---|---|
initialState |
StateVector |
Departure state; its epoch is the departure epoch |
targetState |
StateVector |
Arrival state; its epoch must be strictly after the departure epoch |
centerOfMotion |
CelestialItemsEnum |
Gravitating body |
isRetrograde |
bool, default false |
Search retrograde transfers instead of prograde |
maxRevolutions |
ushort, default 0 |
Each additional revolution adds up to two more solutions (left + right branches) |
Position and velocity must be expressible relative to centerOfMotion; the solver works in ICRF.
Returns a list of LambertSolution, each containing:
revolutions— number of completed revolutionsbranch—Left/Rightwhen applicablev1,v2— transfer-orbit velocities at the endpointsdeltaV1,deltaV2— required Δv at each endpointdeltaV— total Δv magnitudeiterations— solver iteration count (diagnostic)
{
"initialState": {
"centerOfMotion": "SUN",
"epoch": { "dateTime": "2024-01-01T00:00:00", "kind": "UTC" },
"frame": "ICRF",
"position": { "x": 1.5e11, "y": 0, "z": 0 },
"velocity": { "x": 0, "y": 29800, "z": 0 }
},
"targetState": {
"centerOfMotion": "SUN",
"epoch": { "dateTime": "2024-07-01T00:00:00", "kind": "UTC" },
"frame": "ICRF",
"position": { "x": 0, "y": 2.28e11, "z": 0 },
"velocity": { "x": -24100, "y": 0, "z": 0 }
},
"centerOfMotion": "SUN",
"isRetrograde": false,
"maxRevolutions": 0
}