Hello people,
I would like to draw lines from side to side of the canvas [random points] but I don’t want that it draws if the drawn line intersect a circle, which is in the middle. My code is this
void setup(){
background(0);
size (800, 400);
}
void draw(){
stroke(255);
line(random(0,800), 0 , 0, random(0,400));
fill(0);
ellipse(width/2, height/2, 100,100);
}
the problem acutally is that this program only draws lines from the top side to the left side because I don’t know how to tell him:
line(random(0,800), 0 or 400 , 0 or 800, random(0,400));
the second problem is that I really don’t know how to tell him: if the line intersect the circle then don’t draw.
Can you help me?
Thanks