E R A Craig, New Zealand - 24 July 2026
This project was edited by Aristotle 28 July 2026 - math Lean included.
To cite Aristotle:
- Tag @Aristotle-Harmonic on GitHub PRs/issues
- Add as co-author to commits:
Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
Computing with 3D geometry — shapes are numbers, distances are operations.
# Run all tests
python3 spatial_arithmetic_final.py
# Evaluate an expression
python3 spatial_arithmetic_final.py --eval "3+4*5"
# Output: 3+4*5 = 23
# Build and decode a scene
python3 spatial_arithmetic_final.py --scene 7 ADD 3
# Output: 7 ADD 3 = 10 (decoded: a=7, b=3, op=ADD)
# Open interactive demo
# Open demo.html in a browserA number is encoded as a 3D shape — a non-planar unit-distance cycle (a ring of points where each consecutive pair is exactly 1 unit apart).
| Value | Nodes | Parity |
|---|---|---|
| +5 | 14 (2×5+4) | Even → positive |
| -3 | 11 (2×3+5) | Odd → negative |
| 0 | 4 | Even → zero |
Decode: value = ±((nodes - 4) / 2), sign from even/odd parity.
The distance between two shapes (measured as a ratio to their radius) encodes the operation:
| Distance Ratio | Operation | Precedence |
|---|---|---|
| 3× radius | MULTIPLY | Highest (closest) |
| 4× radius | ADD | |
| 5× radius | SUBTRACT | |
| 6× radius | DIVIDE | Lowest (farthest) |
Why closer = higher precedence: The Observer evaluates the closest shapes first. By placing MULTIPLY closer than ADD, 3 + 4 × 5 naturally evaluates as 3 + (4 × 5) = 23.
The Observer is the active engine. It:
- Clusters points by unit-distance connectivity
- Decodes each cluster (node count → value)
- Reads operators (distance ratio → opcode)
- Evaluates with standard mathematical precedence
The Observer contains ALL logic. The geometry is purely passive data.
Division returns Python Fraction objects — exact rational arithmetic with no floating-point error:
7 ÷ 3 = 7/3 (not 2.333...)
10 ÷ 4 = 5/2 (not 2.5)
1 ÷ 7 = 1/7 (not 0.142857...)
GEOMETRY (passive data) OBSERVER (active engine)
───────────────────── ──────────────────────
Vertices, edges, positions Clustering algorithm
No logic, no computation Operator lookup tables
Like grooves on vinyl Precedence evaluator
Like the needle on a turntable
| Test | Scope | Result |
|---|---|---|
| Parity Encoding | 0–20 × ±1 | 42/42 = 100% |
| Signed Roundtrip | 10 values × 50 seeds | 100% |
| Full Pipeline | 0–10, all ops | 1452/1452 = 100% |
| Division | 4 cases | 100% (exact fractions) |
| Signed Pipeline | ±5–±10, all ops | 768/768 = 100% |
| Expressions | 9 cases (incl. precedence) | 9/9 = 100% |
Expressions are evaluated with standard mathematical precedence:
3 + 4 × 5 = 23 (multiply first)
10 - 2 × 3 = 4 (multiply first)
1 + 2 × 3 + 4 = 11 (multiply first, then left-to-right)
-5 + 3 × (-2) = -11 (multiply first)
100 ÷ 10 - 3 = 7 (divide first)
Two independent operator channels exist:
- Distance → operation (ADD, SUB, MUL, DIV)
- Dihedral angle → modifier (none, square, negate, reciprocal)
4 distance ratios × 5 angle bins = 20 distinct operations from a single shape pair.
- Relational information theory: 87.5% of source entropy recoverable from bit-relationships alone
- Relational computation: MAJORITY via equality graph, zero mismatches vs conventional
- Cayley-Menger determinant: Centroid distance computable from pairwise distances only
- Ultrametric bounds: Minimum operator gap = 1.0 × radius (safe for pure computation)
| File | Description |
|---|---|
spatial_arithmetic_final.py |
Absolute final script — tests + CLI |
demo.html |
Interactive web visualization |
STUDY.md |
Comprehensive study document |
spatial_arithmetic_v4.py |
Previous version (parity encoding) |
exp*.py |
Individual experiments |
- Minimum operand: 4 nodes (non-planarity requirement)
- Maximum practical operand: ~50 (shapes become large)
- No physical noise tolerance (pure computation framework)
- Angle channel not yet integrated (tested, working, future work)
- Fractional binding not yet integrated (designed, not built)
If you use this work, please cite:
Spatial Arithmetic: A framework for computing with 3D geometry where numbers are encoded as non-planar unit-distance cycles and operations are encoded as spatial relationships between shapes.