A 3D function graph plotting tool designed for early handheld devices such as Windows CE 1.0 - 2.1, Palm OS 3, and CASIO fx-9860 series calculators.
This project is still in progress. Feedback and issues are welcome.
Copy the .exe matching your CPU architecture to the device via Active Sync or external storage (CF, SD card) and run it.
Note: For newer ARM-based devices (Windows CE 5.0, Windows Mobile), use
PlotterZ_hpc211_armdbg.exe.
Install the .prc file via HotSync and run it.
Note: MathLib is required. Download and install it from palmdb.net/app/mathlib before running Plotter-Z.
Connect the calculator to your PC via USB and use FA-124 to transfer the .g1a file, or copy it directly through Windows Explorer, or via an SD card to the calculator's storage.
The following mathematical functions can be used in expressions:
| Function | Description | Parameters |
|---|---|---|
sin(x) |
Sine | 1 |
cos(x) |
Cosine | 1 |
tan(x) |
Tangent | 1 |
asin(x) |
Arcsine | 1 |
acos(x) |
Arccosine | 1 |
atan(x) |
Arctangent | 1 |
sqr(x) |
Square root | 1 |
exp(x) |
Exponential (e^x) | 1 |
abs(x) |
Absolute value | 1 |
ln(x) |
Natural logarithm | 1 |
File>Samplesto pick a preset sample expression.Edit>Expressionto enter your own expression.Edit>Windowto adjust the plot range (X/Y/Z bounds and grid resolution).Viewto switch between interaction modes: camera rotation, pan move, zoom, and formula positioning.View>Resetto restore the default camera angles and viewport.File>Save Session/Load Sessionto persist or restore your current expression and window settings.
You can also toggle a footer status bar (View > Toggle Footer) showing the current camera angles, mode, and zoom level, and toggle the bounding box (View > Toggle Boundary Box).
-
Main screen:
- Enter an expression and tap
Parse. If there are no errors the app renders the mathematical formula. Options>Window Editorto set the X/Y/Z plot ranges and grid resolution.Options>Samplesto choose from preset sample expressions.- Tap
Drawto enter the 3D drawing view.
- Enter an expression and tap
-
Drawing view:
- The four corners of the screen are interactive buttons:
- Top-left — return to the main screen.
- Top-right — cycle through interaction modes (
C= Camera rotate,P= Pan move,Z= Zoom). - Bottom-left — toggle the bounding box (
b/B). - Bottom-right — reset camera angles, viewport, and zoom level.
- Drag on the canvas to interact (rotate / pan / zoom depending on the current mode).
- The four corners of the screen are interactive buttons:
-
Main Screen:
Key Action F1 Edit expression F2 Window Editor (set X/Y/Z ranges and grid) F3 Browse sample expressions F4 Help screen F6 Enter Graph Screen (recalc and plot) Arrow keys Move formula position -
Graph Screen:
Key Action F1 Return to Main Screen F3 Animate: increment variable tby 1 and recalculateF4 Reset Camera F5 Toggle bounding box F6 Toggle bottom menu Arrow keys Rotate camera 2 / 4 / 6 / 8 Pan (translate viewport) + / - Zoom in / out -
Animation: Insert the variable
tinto your expression to create animated surfaces. Each time you press F3 in the Graph Screen,tincrements by 1 and the surface is recalculated, creating a frame-by-frame animation effect.
If the program fails with FAILED: DIB SECTION, some devices (tested on CASIO E-100 and iPAQ H3600) have trouble creating a 16-bit DIB section.
Create a file named plotter-z.ini in the root directory of your CE device with the following content to force 8 bpp mode:
[graphics]
force_bpp=8The project is divided into several modules:
| Directory | Purpose |
|---|---|
formula-z |
String expression parser |
evaluator-z |
Micro VM for numerical evaluation |
renderer-z |
AST to render tree conversion |
plotter-z |
Platform-specific app frontends |
This module takes a string input, checks for syntax errors, and converts the string into an AST (Abstract Syntax Tree).
Run tests with make fz-test:
./fz-test.exe -h "sin(sqr(x^2+y^2))"Output:
<Function name="sin">
<Parameter>
<Function name="sqr">
<Parameter>
<Binary operator="ADD">
<Binary operator="POW">
<Variable> x </Variable>
<Literal> 2 </Literal>
</Binary>
<Binary operator="POW">
<Variable> y </Variable>
<Literal> 2 </Literal>
</Binary>
</Binary>
</Parameter>
</Function>
</Parameter>
</Function>This module takes the AST generated by formula-z, checks for semantic errors, and compiles it into instructions for a micro virtual machine.
Run tests with make ez-test:
# -v declares variables x, y and sets them to 1 and 2
# -l lists compiled instructions
# -e specifies the expression
./ez-test.exe \
-v x 1 \
-v y 2 \
-l \
-e "sin(sqr(x^2+y^2))"Output:
PUSH_VAR 0
PUSH_IMD 2
POW
PUSH_VAR 1
PUSH_IMD 2
POW
ADD
FUNC sqr
FUNC sin
Result = 0.786749
This module takes the AST generated by formula-z and converts it into a render tree.
Run tests with make rz-test:
./rz-test.exe -h "sin(sqr(x^2+y^2))"Output:
<Horizontal>
<Text> sin </Text>
<Enclosure>
<Root>
<Horizontal>
<Superscript>
<Body>
<Text> x </Text>
</Body>
<Script>
<Text> 2 </Text>
</Script>
</Superscript>
<Text> + </Text>
<Superscript>
<Body>
<Text> y </Text>
</Body>
<Script>
<Text> 2 </Text>
</Script>
</Superscript>
</Horizontal>
</Root>
</Enclosure>
</Horizontal>This module contains platform-specific implementations of the plotter-z app.
| Directory | Purpose |
|---|---|
sdl |
Proof-of-concept app using SDL |
win32-classic |
Test only, deprecated |
win32-native |
Win32 API app for Windows CE / Desktop |
palm |
Palm OS version |
fx |
CASIO fx-9860 version |
The project favours an out-of-the-box approach, just use each platform's official SDK and toolchain with zero extra configuration.
This project depends on two small libraries:
- salvia89 — a compact
sprintfreplacement. Required because Windows CE 1.0 / 2.0 do not providesprintf, and theirwsprintflacks important features. - pine89 — a lightweight INI file parser.
Run the fetch-deps.sh script to clone them:
cd project-path
./fetch-deps.shIf you cannot run a shell script or don't have Git, you can clone the repositories manually, or download their source from GitHub and place them into the deps directory (refer to the script for exact locations).
Requires an SDL 1.2 development environment plus GCC and make. Run:
makeRequires one of the following:
- CE 1.x: Visual C++ 5.0 + Windows CE Toolkit for Visual C++ 5.0 (needs Windows NT 4)
- CE 2.x / Desktop: Visual C++ 6.0 + Windows CE Toolkit for Visual C++ 6.0
Open the *.dsw workspace file in the corresponding Visual C++ and build.
Requires CodeWarrior IDE for Palm. Open the *.mcp project file and build.
Requires the fx-9860G SDK. Open the *.g1w project file and build.
This project is licensed under the MIT License.