Loop with increasing inclination

check this …

  for(int i=0,w=0; i<width; i+=20+w) {
    stroke(0,0,255);
    line(i+50,0, i,height);
    stroke(0,255,0);
    line(i+50+10+w,0, i+10+w,height);    
    if (i < 500) {
      w=w+1;
    }
  }

1 Like

or this …

  int mywidth = 10;
  strokeWeight(mywidth);  
  
  for(int i=0,w=0; i<width; i+=20+w) {
    stroke(0,0,255);
    line(i+50,0, i,height);
    stroke(0,255,0);
    line(i+50+mywidth+w,0, i+mywidth+w,height);    
    if (i < 500) {
      w=w+1;
    }
  }
1 Like

thank you so much, now that I see it , it seems so obvious :sweat_smile: :sweat_smile: :sweat_smile:

1 Like

Thank you! I feel embarrased because so often my problem is mathematical, not only about programming language

“Mistakes have the power to turn you into something better than you were before.”
— Oscar Auliq-Ice

:grin:

1 Like