home *** CD-ROM | disk | FTP | other *** search
- /* Plotting example */
-
- NormalSize
- Reduce /* Select a nice size screen */
- UnselectAll /* Don't modify existing objects */
- PenNum 2 /* Black pen */
- FillNum 0 /* Fill pattern 'none' */
- DrawOff /* Don't show axes drawing */
-
- xOffset = 320 /* Set x and y offsets since this is not */
- yOffset = 0 /* a standard Cartesian plane */
-
- NewLine 1 400 639 400 /* Draw x and y axes */
- NewLine 320 1 320 700
- DrawOn /* Show the axes before drawing graph */
- DrawOff /* Don't show graphing of equation */
- ourPoly = 'newpoly'
- x = -300 /* This is x's starting point */
- do until x > 300
- y = (x*x)%100 /* Calculate the Cartesian y */
- /* Insert your own equation to plot */
-
- if (x+xOffset)>0 & (400-(y+yOffset))>0 & (x+xOffset)<640 & (400-(y+yOffset))<720 then /* Bounds check */
-
- ourPoly = ourPoly (x+xOffset) (400-(y+yOffset))
- /* This statement only gets executed if the new
- point is within the bounds of the page */
-
- x = x + 10 /* This is our step for our loop which
- may need to be adjusted so that the
- AREXX line length does not go over
- 800 lines. */
- end
- ourPoly /* Now draw the graphed polygon */
- PolySmooth /* Make this polygon smooth */
- DrawOn /* Show the drawing */
-