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
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
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 drawings 'add up'.
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
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
All contents of EZ Math Movie are copyrighted: Copyright 2011, Edward A. Zobel. All rights reserved.
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.