Skip to content

Commit

Permalink
(fix) remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibFrgsGmz committed Jun 13, 2023
1 parent b98dcbd commit 3443b22
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/tools/lambert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,6 @@ pub struct LambertSolution {
pub phi: f64,
}

/// Calculate the new values of phi, c2, and c3 based on the current value of phi.
///
/// # Arguments
///
/// `phi` - The current value of phi.
///
/// # Returns
///
/// `(f64, f64, f64)` - The new values of phi, c2, and c3.
fn calculate_phi_and_c2_c3(phi: f64) -> (f64, f64, f64) {
let mut c2 = 0.5;
let mut c3 = 1.0 / 6.0;

if phi > LAMBERT_EPSILON {
let sqrt_phi = phi.sqrt();
let (s_sphi, c_sphi) = sqrt_phi.sin_cos();
c2 = (1.0 - c_sphi) / phi;
c3 = (sqrt_phi - s_sphi) / phi.powi(3).sqrt();
} else if phi < -LAMBERT_EPSILON {
let sqrt_phi = (-phi).sqrt();
c2 = (1.0 - sqrt_phi.cosh()) / phi;
c3 = (sqrt_phi.sinh() - sqrt_phi) / (-phi).powi(3).sqrt();
}

(phi, c2, c3)
}

/// Solve the Lambert boundary problem using a standard secant method.
///
/// Given the initial and final radii, a time of flight, and a gravitational parameters, it returns the needed initial and final velocities
Expand Down

0 comments on commit 3443b22

Please sign in to comment.