KALC(1)

NAME
kalc - powerful CLI calculator and grapher

SYNOPSIS
kalc [OPTIONS] [equation1] [equation2] [...]

DESCRIPTION
kalc is a command-line calculator supporting symbolic math, plotting, unit calculations, complex numbers, matrices, statistics, probability distributions, and more. It saves history, configuration, and variable files in:

- History: $config_dir/kalc/kalc.history
- Config: $config_dir/kalc/kalc.config
- Permanent Vars/Functions: $config_dir/kalc/kalc.vars

Sample config files and examples are available in the source repository.

OPTIONS

--help
    Show general help message.

--man
    Prints a kalc.1 manpage

--help thing
    Show detailed help for a specific function or feature.

--interactive, -i
    Enter interactive mode after evaluating given expressions.

--units
    Toggle unit calculations.

--notation=e/E/s/n
    Set scientific notation style: 3e2, 3E2, 3×10^2, or 300.

--graph=normal/domain/domain_alt/depth/flat/none
    Change graphing style.

--label=x,y,z
    Set axis labels for graphs.

--angle=deg/rad/grad
    Set angle unit.

--2d=num
    Number of points to graph in 2D.

--3d=x,y
    Number of points to graph in 3D.

--xr=, --yr=, --zr=min,max
    Set graphing ranges.

--range=num
    Set all graph ranges to [-num,num].

--vxr=, --vyr=, --vzr=min,max
    Override visible graphing ranges.

--vrange=num
    Override visible range on all axes.

--gnuplot
    Use external gnuplot for graphing.

--saveto=filename
    Save graph output to file (PNG).

--color=true/false/auto
    Toggle color output.

--polar
    Display polar vectors.

--prec=num
    Set calculation precision (default 512 bits).

--deci=num
    Set decimal display length.

--frac
    Display fractions where possible.

--multi, --tabbed
    Matrix display modes.

--surface
    Show colored 3D surfaces.

--scalegraph
    Scale graphs based on terminal size.

--siunits
    Force SI base units.

--keepzeros
    Keep trailing zeroes.

--progress
    Show graphing progress.

--vars
    Disable loading default variables and kalc.vars.

--default
    Ignore kalc.vars and use default settings. Many more options available, see --help for a full list.

USAGE
You can execute multiple equations as arguments or run interactively. Common commands:

    - Use ans or _ for previous result.
    - Define variables with a = {expr}.
    - Define functions with f(x) = {expr}.
    - Plotting by appending # to expressions: e.g., sin(x)#
    - Clear screen: clear
    - Exit: exit
    - History: history [search]
    - List variables: vars
    - Temporary setting override: option/var;function
    - Use help inside kalc for full language guide.

INSTALLATION

Linux
    Use the AUR or:

    cargo install kalc

Windows
    Download kalc.exe from GitHub releases. Needs a modern terminal (e.g., Windows Terminal or Alacritty). Install gnuplot via winget or Sourceforge.

macOS
    Install Xcode tools:

    xcode-select --install

    Then:

    brew install gnuplot
    cargo install kalc

    May need to suppress gnuplot warnings: kalc 2> /dev/null

BUILD INSTRUCTIONS
If encountering gmp-mpfr-sys build issues, in Cargo.toml change:

    features = ["force-cross"] to features = ["use-system-libs"]

Linux
    Requires Rust ≥1.79.0, diffutils, gcc, m4, make:

    git clone https://github.com/bgkillas/kalc
    cd kalc
    cargo build --release

Windows
    Follow [gmp-mpfr-sys] guide for MSYS2 and cargo setup.

macOS
    Ensure no spaces in build path, then standard build procedure.

FILES

$config_dir/kalc/kalc.history
    History of past calculations.

$config_dir/kalc/kalc.config
    Configuration options.

$config_dir/kalc/kalc.vars
    Permanent user-defined variables and functions.

SEE ALSO
cargo(1), gnuplot(1)

AUTHOR
Written by bgkillas.

Source code available at: https://github.com/bgkillas/kalc