Skip to main content

stradv

Function stradv 

Source
pub fn stradv(
    q: f64,
    r: &mut Vec3,
    v: &mut Vec3,
    rad: f64,
    acc: f64,
    smax: f64,
) -> f64
Expand description

stradv advances a particle of given position and velocity until it reaches a specified radius. It then returns with updated position and velocity. It is up to the user not to request a value that cannot be reached.

Arguments:

  • q: mass ratio = M2/M1
  • r: Initial and final position
  • v: Initial and final velocity
  • rad: Radius to aim for
  • acc: Accuracy with which to place output point at rad.
  • smax: Largest time step allowed. It is possible that the routine could take such a large step that it misses the point when the stream is inside the requested radius. This allows one to control this. Typical value = 1.e-3.

Returns:

  • time step taken