Skip to main content

gooding_lambert

Function gooding_lambert 

Source
pub fn gooding_lambert(
    gm: f64,
    r1: &[f64; 3],
    r2: &[f64; 3],
    nrev: i32,
    tdelt: f64,
    v1: &mut [f64; 3],
    v2: &mut [f64; 3],
) -> i32
Expand description

Low-level Lambert solver matching the C/FORTRAN calling convention.

§Warning: No input validation

This function performs no input validation. It does not check for non-positive gm, zero-length position vectors, non-finite values, or 180-degree singular transfers. Invalid inputs produce undefined numerical results (NaN, infinity, or meaningless velocities) without any error signal.

Use lambert() instead for a validated, idiomatic Rust API. This function is public for two purposes:

  1. Cross-validation with the original C/FORTRAN implementation — the argument list intentionally mirrors the C lambert() function, using signed nrev and signed tdelt with the same conventions.
  2. Advanced use where callers have already validated inputs and need direct access to the C-matching interface.

§Calling convention (C/FORTRAN-matching)

  • nrev: signed revolution count. |nrev| is the number of complete revolutions. The sign selects the solution family for multi-rev cases: positive = long-period, negative = short-period. For nrev == 0, the sign is irrelevant.
  • tdelt: signed time of flight. Positive = prograde transfer, negative = retrograde transfer.

Returns a status code: 1 on success, 0 if no solution exists, -1 on error.