MathBeans
Welcome to the MathBeans package
The MathBeans package consists of Java GUI (AWT) components with embedded
mathematical engine. The components are packaged as Java beans and can
be added to any IDE that supports beans (in particular,
VisualAge® for Java).
Fully visualizable numerical objects, the first in the industry!
Currently the package consists of the following components:
-
CalcField - a
TextField with embedded mathematical engine
CalcField (Calculator enabled field
bean) is a text field in which the user can enter any constant mathematical
expression and press Enter. The expression gets computed and the result
is displayed in the same field. The user can set parameters that control
the format of the output. The field has an optional cyclic history buffer
controlled by up/down keys.
-
CalcPanel - a
Panel with embedded mathematical engine
CalcPanel (Calculator panel bean)
provides the following functionality: based solely on a string representing
a mathematical expression with any number of variables, it automatically constructs
and displays a mini-calculator panel for this expression. The panel will
have input fields for all variables in the expression, each with the label
representing its name, and a similar field and label for result. The user
enters any numbers into the input fields and presses Enter in any of these
fields. The result is immediately computed and displayed in the result
field. The user can set parameters that control the format of the output.
If desired, the appearance of the panel can be further customized.
This bean provides a unique possibility of creating various calculators,
static or dynamic, avoiding the hassle of setting up GUI, adding logic,
dispatching events, etc. The user's only input is the formula itself,
all the rest is figured out by the bean.
A simple example. Your code:
numobj.mathbeans.CalcPanel panel = new numobj.mathbeans.CalcPanel
();
panel.setFormula ("Total amount:=Quantity*Item_price*(1+Tax_rate/100)+Shipping");
You get:
As soon as one enters values in the first four fields and presses Enter,
the field "Total amount" will display the computed value.
-
CalcGraphPanel -
a Panel with embedded mathematical engine and graphing capabilities
CalcGraphPanel (Calculator graph
panel bean) is an extension of the CalcPanel.
Based solely on a string representing a mathematical expression with any
number of variables, it automatically constructs and displays a mini-calculator
and graph panel for this expression. The mini-calculator panel is a CalcPanel
bean (see above). The graph panel lets the user plot the result as
a function of any of its variables and print the graph. Again, the user's
only input is the formula itself, all the rest is figured out by the
bean.
Your code:
numobj.mathbeans.CalcGraphPanel panel = new numobj.mathbeans.CalcGraphPanel
();
panel.setFormula ("Total amount:=Quantity*Item_price*(1+Tax_rate/100)+Shipping");
You get:
To plot the graph, press the Plot button. On the calculator panel,
the field corresponding to the chosen independent variable may contain anything
as well as be blank. The fields for the other variables must contain values.
The graph panel is initially blank. After the graph is plotted
it would display also the X and Y axes if they fall within the graph range,
and marks for measurements in the X and Y directions. After the graph is
plotted, the Print button gets enabled, and the graph can be printed.
The panel is dynamically resizable with the automatic adjustment of
the graph. It can also be rolled up to a usual CalcPanel
and extended to its full form by pressing a single (+/-) button.
Supported formulae
All the components are based on the Numerical Objects' mathematical Java
library. The library contains over 50 elementary and special
functions computed with 15 digits of accuracy as well as procedures
for numerical integration, summation, equation solving and extremum search.
Functions and procedures can be arbitrarily nested. Code samples and test
applications are provided.
For more information, visit the
Numerical Objects home page
[
Catalog Home
]
|