Skip to main content

lambert

Function lambert 

Source
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 arrival
  • tof: time of flight (must be positive)
  • nrev: number of complete revolutions before arrival (0 = single arc)
  • dir: Direction::Prograde or Direction::Retrograde
  • period: MultiRevPeriod::LongPeriod or MultiRevPeriod::ShortPeriod — selects which solution family to return for multi-revolution transfers (nrev >= 1). Ignored when nrev == 0.

§Errors