fn draw_segments(draw: &Draw, model: &Model, x: f32, y: f32, rotation: f32) {
  // TODO: explore having a random radians_per_segment
  let radians_per_segment = (2. * PI) / model.n_segments as f32;
  for n in 0..model.n_segments {
    let factor = n as f32 / model.n_segments as f32;
    let start_theta = n as f32 * radians_per_segment;
    let end_theta = (n + 1) as f32 * radians_per_segment;

    let max_radius = model.max_radius;
    let min_radius = lerp(model.min_radius, model.max_radius, factor * 2.);
    // interesting alternative
    // let min_radius = lerp(model.min_radius, model.max_radius, factor);

    draw_segment(
      model.hue4,
      model.sat,
      model.lum,
      min_radius,
      max_radius,
      start_theta,
      end_theta,
      x,
      y,
      rotation,
      draw,
    );
  }
}
/// draw all segments around the circle
draw all segments around the circle
draw all segments around the circle
fn draw_segments(draw: &Draw, model: &Model, x: f32, y: f32, rotation: f32) {
  // TODO: explore having a random radians_per_segment
  let radians_per_segment = (2. * PI) / model.n_segments as f32;
  for n in 0..model.n_segments {
    let factor = n as f32 / model.n_segments as f32;
    let start_theta = n as f32 * radians_per_segment;
    let end_theta = (n + 1) as f32 * radians_per_segment;
    let max_radius = model.max_radius;
    let min_radius = lerp(model.min_radius, model.max_radius, factor * 2.);
    // interesting alternative
    // let min_radius = lerp(model.min_radius, model.max_radius, factor);
    draw_segment(
      model.hue4,
      model.sat,
      model.lum,
      min_radius,
      max_radius,
      start_theta,
      end_theta,
      x,
      y,
      rotation,
      draw,
    );
  }
}
fn draw_segments ( draw : & Draw , model : & Model , x : f32 , y : f32 , rotation : f32 ) { // TODO: explore having a random radians_per_segment let radians_per_segment = ( 2. * PI ) / model . n_segments as f32 ; for n in 0 .. model . n_segments { let factor = n as f32 / model . n_segments as f32 ; let start_theta = n as f32 * radians_per_segment ; let end_theta = ( n + 1 ) as f32 * radians_per_segment ; let max_radius = model . max_radius ; let min_radius = lerp ( model . min_radius , model . max_radius , factor * 2. ) ; // interesting alternative // let min_radius = lerp(model.min_radius, model.max_radius, factor); draw_segment ( model . hue4 , model . sat , model . lum , min_radius , max_radius , start_theta , end_theta , x , y , rotation , draw , ) ; } }
draw all segments around the circle
draw all segments around the circle
draw
&Draw
model
&Model
x
f32
y
f32
rotation
f32