pub fn generate_with(
    mass_range: std::ops::Range<f32>,
    allow_negative_mass: bool,
    x_range: std::ops::Range<f32>,
    y_range: std::ops::Range<f32>,
  ) -> Self {
    let mass = if allow_negative_mass && chance() {
      random_range(-mass_range.start, -mass_range.end)
    } else {
      random_range(mass_range.start, mass_range.end)
    };
    let x = random_range(x_range.start, x_range.end);
    let y = random_range(y_range.start, y_range.end);
    Self { mass, x, y }
  }
// Generate GravitationalBodies with a given mass range,
// x range, and y range.
// When allow_negative_mass is true, masses may randomly
// be generated in the negative of the range provided.
Generate GravitationalBodies with a given mass range,
x range, and y range.
When allow_negative_mass is true, masses may randomly
be generated in the negative of the range provided.
Generate GravitationalBodies with a given mass range x range and y range . When allow_negative_mass is true masses may randomly be generated in the negative of the range provided .
pub fn generate_with(
    mass_range: std::ops::Range<f32>,
    allow_negative_mass: bool,
    x_range: std::ops::Range<f32>,
    y_range: std::ops::Range<f32>,
  ) -> Self {
    let mass = if allow_negative_mass && chance() {
      random_range(-mass_range.start, -mass_range.end)
    } else {
      random_range(mass_range.start, mass_range.end)
    };
    let x = random_range(x_range.start, x_range.end);
    let y = random_range(y_range.start, y_range.end);
    Self { mass, x, y }
  }
pub fn generate_with ( mass_range : std :: ops :: Range < f32 > , allow_negative_mass : bool , x_range : std :: ops :: Range < f32 > , y_range : std :: ops :: Range < f32 > , ) -> Self { let mass = if allow_negative_mass && chance ( ) { random_range ( - mass_range . start , - mass_range . end ) } else { random_range ( mass_range . start , mass_range . end ) } ; let x = random_range ( x_range . start , x_range . end ) ; let y = random_range ( y_range . start , y_range . end ) ; Self { mass , x , y } }
Generate GravitationalBodies with a given mass range,
x range, and y range.
Generate GravitationalBodies with a given mass range x range and y range .
mass_range
std::ops::Range<f32>
allow_negative_mass
bool
x_range
std::ops::Range<f32>
y_range
std::ops::Range<f32>