I am trying to draw parallel lines diagonally from the upper right corner to the lower left corner of the image. I want it to look like this (beautiful picture drawing)

def diagTopLBottomR(): pic=makePicture(pickAFile()) w=getWidth(pic) h=getHeight(pic) x1=0 y1=0 x2=0 y2=0 i=0 while i<11: x1=10*i y2=10*i i+=1 for y in range (y1,y2): x = (y-y1)*(x2-x1)/(y2-y1) +x1 px=getPixel(pic,x,y) color=makeColor(0,0,0) setColor(px, color) x3=0 y3=h x4=w y4=0 j=0 while j<10: x3=10*j y4=10*j j+=1 for y in range (y3,y4): x = (y-y3)*(x4-x3)/(y4-y3) +x3 px=getPixel(pic,x,y) color=makeColor(0,0,0) setColor(px, color) return(pic)
You will notice that x3 will either be the maximum value, causing an exception to the range, or the range y will start from a higher value, i.e. (y3> y4), and will not work the other way around, or when I reduce it. This is like a paradox.
The first cycle works, no matter what, I cannot get the second cycle to work. This is what I get.

Any ideas? Thanks.
Edit
I played with ranges and did not get results for the second cycle, as shown above, from an exception outside the range.
I tried:
x3=0 y3=h x4=w y4=0 j=0 while j<10: x3=10*j y4=10*j j+=1 for x in range (x3,x4): y = (x-x3)*(y4-y3)/(x4-x3) +y3
Steal the unicorns from here .