A terminal-based step-by-step math calculator covering all major PreCalc 12 topics. Built in Python with optional graphing via Plotly.
- Python 3.8+
- Optional (for graphs):
numpyandplotly
pip install numpy plotlypython main.pymegacalc/
├── main.py ← Entry point / main menu
└── modules/
├── utils.py ← Shared helpers (formatting, input, graph engine)
├── m01_transformations.py
├── m02_polynomials.py
├── m03_rational.py
├── m04_explog.py
├── m05_trig_functions.py
├── m06_trig_identities.py
├── m07_sequences.py
├── m08_combinatorics.py
├── m09_binomial.py
└── m10_inverses.py
Analyse y = a·f(b(x−h)) + k for any parent function.
- Describe all 4 transformation parameters step by step
- Map key points from parent to transformed graph
- Identify stretch/reflection/translation from two points
- Supported parents: linear, quadratic, cubic, sqrt, abs, rational, exponential, log, sin, cos, tan
- Graph: transformed vs parent curve
- End behaviour from degree and leading coefficient
- Evaluate at a point using Horner's method
- Rational Root Theorem — lists and tests all ±p/q candidates
- Synthetic division with full table
- Full factoring (iterative rational roots + quadratic formula)
- Root multiplicity with crossing/touching behaviour
- Graph: labelled roots and y-intercept
- Vertical asymptotes and holes (with hole coordinates)
- Horizontal and oblique asymptotes (polynomial long division shown)
- x- and y-intercepts
- Full analysis combining all of the above
- Solve rational equations (cross-multiply + check extraneous solutions)
- Graph: asymptotes as dashed lines, holes as open circles, all points labelled
- Laws of logarithms reference + evaluator
- Solve
a·b^(mx+n) = cstep by step - Solve
a·log_b(mx+n) = cstep by step - Change of base
- Growth & decay table + doubling time / half-life
- Compound interest (annual, semi, quarterly, monthly, daily, continuous)
- Graph: exponential or log with transformation parameters
- Evaluate sin, cos, tan, sec, csc, cot at any angle
- Describe graph parameters: amplitude, period, phase shift, vertical shift
- Reciprocal trig reference + evaluator
- Unit circle table (all 16 standard angles, degrees + radians)
- Graph: any trig or reciprocal function with full
a·f(bx−c)+dtransformations
- Full identity reference sheet (Pythagorean, reciprocal, sum/difference, double-angle, half-angle, co-function)
- Numerically verify identities at multiple test angles
- Solve
a·f(bx+c) = din [0°, 360°] with CAST rule - Solve using Pythagorean substitution
- Apply sum/difference identities step by step
- Apply double-angle identities (all three forms for cos)
- Arithmetic sequence: nth term, partial sum, first terms
- Geometric sequence: nth term, partial sum, first terms
- Infinite geometric series with convergence check
- Sigma notation evaluator (any Python expression)
- Identify sequence type from terms (arithmetic, geometric, quadratic)
- Fundamental Counting Principle (multi-stage events)
- Permutations nPr
- Combinations nCr
- Permutations with repetition (n^r)
- Arrangements with repeated elements (n! / a!b!...)
- Expand
(a+b)^nsymbolically for any n up to 25 - Find a specific term
T(k+1) = nCk · a^(n−k) · b^k - Pascal's triangle (up to 20 rows)
- Inverse of linear:
y = mx + b - Inverse of power:
y = axⁿ - Inverse of exponential and logarithmic functions
- Numerically verify two functions are inverses (
f(g(x)) = x) - Compose functions symbolically with sample point table
- Evaluate
f(g(a))step by step
Every calculation follows the same pattern:
┌─ Step 1: <what this step does>
│
working lines (dimmed)
key values highlighted
╔──────────────────╗
║ Answer: value ║
╚──────────────────╝
- Steps are colour-coded cyan headers — easy to skim
- Working is dimmed so it doesn't compete with results
- Final answers are in a green box — impossible to miss
- Fractions: decimal results show as
0.6667 (= 2/3)where possible
Graphs open in your browser as interactive Plotly charts.
- Hover over any point to see exact
(x, y)coordinates - Scroll to zoom, click-drag to pan
- Roots, intercepts, asymptotes, and holes are all labelled
- Trig graphs use π-based x-axis labels
Graphs are optional — if plotly or numpy aren't installed, the rest of the calculator works fine without them.
- Fraction input supported everywhere: type
3/4instead of0.75 - All modules are independent — you can import any single module on its own
- Tested on Python 3.8+ on Linux, Windows, and macOS
Originally started in Grade 12 as a set of Python CLI scripts to survive PreCalc 12.