Description

The implicit equations grapher that we present here is another example of how our custom AS3 classes in the folder flashandmath->as3 can be used to easily create custom math applets. You will find many more examples as well as extensive discussion of the classes in our book: Flash and Math Applets: Learn by Example

Click on the screen shot below to open the applet in a new window:

Download

Download all source files, including 'as' and 'fla' files, corresponding to this applet in the following compressed folder.

The 'zip' package contains an exhaustively commented 'fla' file as well as all the necessary custom AS3 math classes. It also contains a 'pdf' guide that documents the classes.

The two custom classes crucial to the applet are the MathParser class and the GraphingBoard class. MathParser parses the user's input, in particular the xy-equation entered by the user. MathParser returns a 'compiled' version of the equation in the form suitable for evaluation. The compiled expression can then be evaluated by the parser at any given (x,y) point.

The GraphingBoard class is responsible for displaying the graphing area - graphing board, the coordinate axes, the grid, the tick marks and their labels. The GraphingBoard controls the error display box where messages to the user appear. The appearance and the size of the graphing board are easily customizable using the methods of the GraphingBoard class. The 'fla' file, implicit.fla, contained in the 'zip' package demonstrates how to use GraphingBoard and MathParser.

In the grapher presented here, we use the standard triangle algorithm. Although the results are not always perfect (as with any other algorithm), they are essentially the same as the implicit plots obtained by the computer algebra packages like Maple.

Back to Intermediate Tutorials              Back to Flash and Math Home

We welcome your comments, suggestions, and contributions. Click the Contact Us link below and email one of us.

Adobe®, Flash®, ActionScript®, Flex® are registered trademarks of Adobe Systems Incorporated.