SAPExpress is the Science Access Project's expression evaluator. It is the heart of our Accessible Graphing Calculator and has been implemented as an ActiveX control. Our AudioPlot web page uses SAPExpress so that visitors can enter their own expressions. These expressions are drawn to the screen and also rendered as audio plots.
Expressions are entered into SAPExpress using standard ASCII notation. Pressing enter in the expression text box evaluates the current expression and displays the result. That is all there is to it.
| Function | Syntax | Example | Function | Syntax | Example |
|---|---|---|---|---|---|
| Times | * | 3*4 | Hyperbolic Sine | hsin( ) | hsin(2) |
| Divide | / | 3/4 | Hyperbolic Cosine | hcos( ) | hcos(4) |
| Add | + | 3+4 | Hyperbolic Tangent | htan( ) | htan(2) |
| Subtract | - | 3-4 | Hyperbolic Arcsine | hasin( ) | hasin(0.5) |
| Exponentiation | ^ | 4^2 | Hyperbolic Arccosine | hacos( ) | hacos(3) |
| Sine | sin( ) | sin(2.5) | Hyperbolic Arctangent | hatan( ) | hatan(.6) |
| Cosine | cos( ) | cos(2.5) | Square Root | sqr( ) | sqr(4) |
| Tangent | tan( ) | tan(0.5) | Factorial | ! | 5! |
| ArcSine | asin( ) | asin(0.5) | e to the x | exp( ) | exp(-2.5) |
| ArcCosine | acos( ) | acos(.23) | Logrithm | log( ) | log(3) |
| ArcTangent | atan( ) | atan(.67) | Natural logrithm | ln( ) | ln(2) |
It is possible to define and save constants and expressions. This is done by typing a name for the constant or expression, followed by an equals sign preceeding the expression. To save the evaluated result as defined constant, press Shift-Enter to evaluate rather than Enter. To save the expression itself press Ctrl-Enter. The following example shows how to define the constant pi and to use it in an expression. Don't type the letters included in square brackets below, instead press the designated key combination.
In the expression input box type: pi=3.14159 [Shift-Enter]
The literal 3.14159 is evaluated and its value is returned in the Result box and saved as a defined constant.
That defines pi. Now test it by typing: sin(pi/4) [Enter]
This returns a value of 0.7071...
Return to the AudioPlot Web Page.
Return to the Science Access Project Home Page
This Page is the Property of
Oregon State University
and the
Science Access Project
Copyright 1998. All Rights Reserved.