A scientific calculator project with multiple implementations - all with the aim to work with AAC Software:
- Vanilla HTML Calculator. This is the current main way we recommend to use this. Its offline, works in the browser and as such as a webview in a AAC software system such as the Grid. Try it here
- Python CLI Calculator. This is a command line calculator that can be used in any system that can execute Python scripts. It requires either a pythoon interpreter or a comppiled version. We build this together with a web server that can be used to serve the calculator. IF you want/must have a calculator with minimal screen space eg. in the message bar you need this
- React Version. This is a modern React implementation of the calculator. It is a work in progress and does not yet have all the features of the other implementations.
Untitled.mov
Located in /vanilla-html/
See a demo of this in action here
- Single HTML file calculator that runs in any browser
- No dependencies or installation required
- Supports keyboard shortcuts and memory operations
- Windows installer available for Grid 3 integration
- Basic arithmetic operations (+, -, *, /)
- Scientific functions (sin, cos, tan, log, etc.)
- Memory operations
- Expression history with recall
- Adjustable decimal places (0-15)
- Radians/Degrees toggle
- Unicode math symbol support
- Algebraic expressions
- Random number generation
- Bracket completion preview
The calculator accepts both text and Unicode math symbols:
Text Input | Symbol Input | Description |
---|---|---|
sqrt(x) |
√x |
Square root |
pi |
π |
Pi constant |
* |
× |
Multiplication |
/ |
÷ |
Division |
^2 |
² |
Square |
^3 |
³ |
Cube |
e |
ℯ |
Euler's number |
2 + 2 = 4
1/2 × 20 = 10
√16 = 4
π × 2 = 6.283185307
sin(45) = 0.7071067812
log(100) = 2
√(π) = 1.7724538509
rand() = 0.7324846372 # Random number between 0-1
floor(rand() * 6) + 1 = 4 # Roll a die (1-6)
floor(rand() * 100) + 1 = 42 # Random number 1-100
x^2 + 2x + 1 # Quadratic expression
2x + 2y # Linear expression with variables
- Store current result: Ctrl/⌘ + P (M+)
- Subtract from memory: Ctrl/⌘ + M (M-)
- Recall memory: Ctrl/⌘ + R (MR)
Maybe slightly easier that using M+,M- etc you can reference previous results using the @ symbol followed by the line number. Each line in the history is numbered for easy reference.
1. 10 + 5 = 15
2. 20 + 12.5 = 32.5
3. @2−@1 → (32.5)−(15) = 17.5
@1
references the result from line 11000 - @3
subtracts line 3's result from 1000@2 * @1
multiplies results from lines 2 and 1floor(@1 * 6)
uses line 1's result in a function
The calculator will show both your expression with @ references and the expanded calculation with actual values.
Enter
or=
- Evaluate expressionEscape
- Clear workpad↑
- Previous expression↓
- Next expressionAlt/⌘ + D
- Toggle Degrees/RadiansCtrl + (0-9)
- Set decimal places
- Brackets are automatically completed as you type
- History is scrollable and expressions can be recalled
- Click the DP button or use Ctrl + number to set decimal places
- Toggle between degrees/radians for trigonometry
- Unicode symbols can be typed directly or using text equivalents
Download the latest installer from the Releases page.
Located in /python-cli/
- Command-line interface calculator
- Python implementation with web server option
- Clipboard integration
- Designed for AAC software integration
- Command-line operation
- Clipboard monitoring mode
- Web server interface
- Full mathematical function support
scicalc "2+2" # Basic arithmetic
scicalc "sin(30)" # Trigonometry (degrees)
scicalc "log₂(8)" # Logarithms
scicalc "√16" # Square root
scicalc "5!" # Factorial
scicalc "200+10%" # Percentages
scicalc "2π" # Implicit multiplication
scicalc "2EE3" # Scientific notation
You can control how results are displayed using the --return
option:
scicalc --return answer "2+2" # Only shows the result: "4"
scicalc --return answer,calc "2+2" # Shows both: "4\n2+2 = 4"
scicalc --return full "2+2" # Shows full: "2+2 = 4" (default)
The calculator can interact with the system clipboard in two ways:
scicalc --readpasteboard
This mode continuously monitors your clipboard. When you copy a mathematical expression, it automatically calculates the result and updates the clipboard with both the expression and its result. Great for doing a series of calculations!
scicalc --output-to-pasteboard "2+2"
This copies the result directly to your clipboard instead of displaying it. Can be combined with --return options:
scicalc --output-to-pasteboard --return answer "2+2" # Only copies the number
Note: You cannot use --output-to-pasteboard with --readpasteboard
This calculator is designed to work seamlessly with AAC software. The command-line interface makes it easy to:
- Call from any AAC software that can execute commands
- Copy results to clipboard for pasting
- Use with keyboard shortcuts or switch access
-
Basic Calculation: Set up a button that runs:
scicalc --return answer "YOUR_EXPRESSION"
-
Clipboard Watch Mode: Create a button for continuous calculation:
scicalc --readpasteboard
Then users can copy expressions and get results automatically.
-
Direct to Clipboard: For AAC systems that work better with clipboard:
scicalc --output-to-pasteboard --return answer "YOUR_EXPRESSION"
- Python 3.8 or higher
- Dependencies listed in pyproject.toml
- uv (Python package installer)
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and install
git clone https://github.com/yourusername/scicalccli.git
cd scicalccli
uv pip install -e ".[test]"
uv run pytest
The calculator accepts both text and Unicode math symbols:
Text Input | Symbol Input | Description |
---|---|---|
sqrt(x) |
√x |
Square root |
pi |
π |
Pi constant |
* |
× |
Multiplication |
/ |
÷ |
Division |
^2 |
² |
Square |
^3 |
³ |
Cube |
e |
ℯ |
Euler's number |
Examples:
2×π
or2*pi
→6.283185...
√25
orsqrt(25)
→5
3²
or3^2
→9
Both notation styles work interchangeably, so you can mix and match based on your preference.
Located in /react/
- Modern React implementation
- Component-based architecture
- Enhanced UI/UX
- Work in progress
(NB: this was the precursor to the vanilla html version. We are not actively developing it further. I ❤️ old skool html)
Each implementation has its own development setup. Its pretty obvious. Read the code.
- Will Wade @ AceCentre
- Marion & Katie Stanton @ Candle for nudging me towards how to do this
- Desmos for the math rendering engine inspiration (its still good and free! but there is no clear shortcut and its not easy to run offline)
- Patrick McCabe and Failbroome Academy for the initial idea and testing