# EZ Math Movie, Tutorials, Designs, Random Points and Lines

### Draw a point and a line segment; repeat.

Here is a simple program that sets up the graph and then loops the drawing repeatedly till you click the stop button - a classic way to work with EZ Math Movie.

Study the source code. The graph is set up in the before loop code. Then two things happen repeatedly in the loop code. First, a random x- and y-coordinate are generated, and a point is plotted at those coordinates. Second, a pair of random (x, y) endpoints are generated, and a line segment is drawn between them. As the program runs, the points and line segments are scattered about the graph.

You will have to press the stop button to halt this program.

### Running the example program

This program has one of the classic EZ Math Movie forms. The form works this way:

• Clear and setup the graph once in the before loop code section.
• The before loop section happens once after the 'Go' button is clicked.
• Create a drawing in the loop code section
• This drawing cycle will happen again and again.
• Each cycle will produce a different drawing.
• Each new drawing is drawn upon the previous drawings.
• The graph is not cleared at the start of each drawing.
• Perhaps do something in the after loop code.
• The after loop code executes once after the "Stop" button is clicked.

In our example program each drawing cycle consists of:

• Getting random point coordinates and plotting the point.
• Getting random line segment endpoint coordinates and drawing the line segment.

Click the 'Stop' button to quit the animation.

### The example program

0ptions

Go on input

Bounds:
Sorry, apparently this browser does not support HTML 5 canvas tag graphics.
Printer

Edit: Runtime          View: Starter Suggestion

To runtime:

Storage:

Editor width: Normal Wide

### And....

Next tutorial: Patterned points and line segments

Here are some links to related articles at EZ Programing Demos:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/content/72/6096072/html/ezmathmovie/tutorials/designs/randomPointsAndLines/randomPointsAndLines.php on line 145

Warning: include(http://ezmathmovie.com/ads/ad1View.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/content/72/6096072/html/ezmathmovie/tutorials/designs/randomPointsAndLines/randomPointsAndLines.php on line 145

Warning: include() [function.include]: Failed opening 'http://ezmathmovie.com/ads/ad1View.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/72/6096072/html/ezmathmovie/tutorials/designs/randomPointsAndLines/randomPointsAndLines.php on line 145

### Other sites you may find interesting

Like Math and Physics?

Zona Land Education offers explanations, diagrams, and animations on these topics.
And it is all presented in a clear and casual manner.

Want to learn about programing computers?

EZ Programing Demos has an animated, slow motion, interactive programing language demonstrator.
The site presents basic ideas at a beginner's level.

Custom Search

Name:
Domain:

Name
0

Name:
Name
0