I've got the following formula: $$ clamp(floor(frac((x+y)*5) + 0.2) + floor(frac((y-x)*5) + 0.2)) $$ Frac here means fractional part $frac(x) = x - floor(x)$. Clamp means $max(0,min(x,1))$.
This equation is used to produce the following pattern: Diagonal lines pattern note: the image got squeezed vertically - the lines are actually at 45 degree angles. The way it works is by evaluating every pixel and testing if the pixel satisfies the equation. If it does the result is a 1, if it doesn't the result is 0. 1 and 0 are then mapped to white and black and the image is produced.
Can this be expressed any simpler?