pub fn lambert(
mu: f64,
r1: [f64; 3],
r2: [f64; 3],
tof: f64,
nrev: u32,
dir: Direction,
period: MultiRevPeriod,
) -> Result<LambertSolution, LambertError>Expand description
Solve Lambert’s problem using Gooding’s (1990) method.
This is the primary validated API. For the low-level C-matching interface
(useful for cross-validation with the reference implementation), see
gooding_lambert().
§Parameters
mu: gravitational parameter (m³/s² or km³/s², consistent with position/time units)r1,r2: position vectors at departure and arrivaltof: time of flight (must be positive)nrev: number of complete revolutions before arrival (0 = single arc)dir:Direction::ProgradeorDirection::Retrogradeperiod:MultiRevPeriod::LongPeriodorMultiRevPeriod::ShortPeriod— selects which solution family to return for multi-revolution transfers (nrev >= 1). Ignored whennrev == 0.
§Errors
LambertError::InvalidInput— non-positive tof, zero position magnitude, or non-finite inputLambertError::SingularTransfer— transfer angle is exactly 180° (plane undefined)LambertError::NoSolution— TOF below minimum for the requested revolution countLambertError::ConvergenceFailed— Householder iteration did not converge