David Wanqian Liu :: Java -- PRECISE calculator
PRECISE calculator
Why PRECISE?
PRECISE stands for PRogrammable Expression-based Calculator with
Intuitive Systematic Expandability. The source code is free to be
redistributed and/or modified for noncommercial usage under the terms
of the GNU General Public License. Feel free
to contact me if you have
any questions or great ideas concerning expanding the current
product. I will provide a list of things-to-be-done later in this document.
How to use PRECISE
Keys
The meaning of keys can be found by simply placing the mouse on top of
that key. If the key is sensitized, the semantics of the current key
should be printed at the bottom of the PRECISE calculator.
Key "Shift" is used to alternate every key's definition. If a key has
multiple meanings, two labels will be displayed on it, one on the top
and the other on the bottom. White colored label is the current
key's name, whereas blue colored label is disabled. By pressing
"Shift" key, every key's white and blue colored labels will switch color
with each other. If a key has one single meaning, "Shift" key does not
apply to it.
Modes
Currently, PRECISE supports three modes:
The current mode of the calculator can be switched by pressing "Mode"
key. Current mode is display in title bar at the top of the calculator.
This is the simplest mode in PRECISE calculator, devoted mostly to
simple numerical calculations. Click "Mode" key multiple times until
the title bar indicates the calculator is currently in numerical
calculation mode. Most of every-day useful functions are supported
under this mode (notice that each key has two functions in it). Try
the following sequence:
- "1", "2", "3", "4", "+", "5", "6", "7", "8", "/", "3", "ENTER"
(result is "3126.67")
"ENTER" key is same as "=" sign used in many now-a-day
calculators. "DEL" key can be used to retype a large number if miss
type occurs. "AC" is used to clean the current calculation and start a
new round of inputs.
After you pressed "ENTER" key, the result of last input should be
displayed, otherwise the specific error would be displayed on the
upper half graphing area. Re-enter your input if a mistype might have
occured. You may reuse the result of last calculation if you
immediately apply one of five operators(+-*/^) to it. Otherwise a new
round of calculation is started. Try following examples:
- "1","2","3","+","4","5","6","ENTER","/","5","ENTER" (result is
115.8)
- "1","2","3","+","4","5","6","ENTER","COS","5","ENTER" (result is
0.283662)
Expression evaluation mode is somewhat similar to the numerical
calculation mode, except that the evaluation of an expression is done
only when you pressed "ENTER" key. The input echo area in the middle of the
calculator becomes editable when you are in "expression evaluation
mode". You can either use key pad to enter your expression, or just
type in your expression using keyboard. Try following examples:
- "COS", "(", "PI", "/", "3", ")", "ENTER" (result is 0.5)
- Type in following in the echo area: "COS(PI/6)", then press
"ENTER" (result is 0.866025)
When you switch to "graphics plotting mode", four keys will be
enabled: "[", ",", "]", and "X". The first three keys are used to
specify x range or the expression you want to plot. "X" is the
self-variable you used to specify the function f(X). The input method
is same as what is used in "expression evaluation mode", except that
at the end of the expression, a range specification needs to be
added. The standard format would be: f(X)[x-min, x-max],
where f(X) is a expression containing "X", x-min and x-max are
constant value expressions (does not contain "X"). If you do not
specify "[x-min, xmax]", x range of [-1,1] will be assumed. Try following
examples:
- X^2
- COS(X)+SIN(X)[0,6*PI]
- 1
- Keys
- Graphical key surface
- Texture mapping of all the keys
- Non-regular key shape
- Better 3D effect
- Graphing Area
- Legends
- Tics management
- Extreme conditions handling
- Separate thread during idle time
- Functionality
- Statistics
- Equation solving
- Other scientific calculations
If you have anything else in mind, or would like to work on any of
these enhancement with me, let me
know. All source code and documentation can be found in next section.
Source and Documentation
Tar'ed and gziped calc.tar.gz. Save the
above link, unzip and untar it, you should find the following:
- expression handling package
- user interface package
- calculator applet
- documentation
Here is the javadoc generate PRECISE package documentation.
back to my home page