Click 'Run' to go.

** This is a lot like ploting random points.** So be sure that you understand the following article:

** Drawing random line segments entails calculating 4 random coordinates.** You need a pair of random coordinates for one endpoint and a second pair of random coordinates for the other endpoint. Run the following demo to see this all work in slow motion. There is more information under the demo.

Slow
Medium
Fast

Click 'Run' to go.

Click 'Run' to go.

** We need to find random values for x1, y1, x2, and y2.** Then we need to draw a line from

*In an imaginary computer language, this could look like the following:*

min = -10; max = 10; repeat(10) { x1 = min + rnd() * (max - min); y1 = min + rnd() * (max - min); x2 = min + rnd() * (max - min); x2 = min + rnd() * (max - min); line(x1, y1, x2, y2); }

*Suggested next article:*

The following article is related to this demo: