Catalog · How the catalog works
grcalc
GRcalc 1.0 — A graphical calculator written in Turbo Pascal (2002). Expression parser, math evaluator, BGI graphics renderer.
- ★ 1 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
GRcalc 1.0
A graphical calculator written in Turbo Pascal (2002).
Type a mathematical expression, get a plot on a Cartesian plane. Inspired by the macOS Graphing Calculator and GNUplot.
Features
- Expression parser (state machine → linked list AST)
- Recursive evaluator with function composition (
sin cos tan xworks) - Real-time BGI graphics rendering with zoom
- Supports: sin, cos, tan, cotan, asin, acos, atan, ln, exp, sqrt
- Operators:
+,-,*,/with bracket grouping - Multi-driver graphics: EGA/VGA, CGA, Hercules (linked into the executable)
- Color-coded progress bar: blue (defined), red (out-of-bounds), gray (undefined)
- Error reporting modeled on C's
perror()
Screenshots
y = cos(e(x)) at 60× zoom:

y = ln(cos(x*x)) + atan(x) at 90× zoom:

Architecture
Main program flow:

Expression parser state machine:

Building
Requires Borland Turbo Pascal 7.0. The BGI driver object files (EGAVGA.OBJ, CGA.OBJ, HERC.OBJ) are included and linked directly into the executable.
A pre-built GRCALC.EXE is provided in bin/.
Documentation
Full documentation (24 pages, in Italian) is in doc/grcalc-doc.rtf.
Flowcharts were drawn in CorelDRAW (doc/flux.cdr).
License
Copyright (C) 2002 Marcello Barnaba vjt@openssl.it
Licensed under the GNU General Public License v2 or later.

