5

kalk - A flexible calculator that supports variables and functions defined by th...

 2 years ago
source link: https://kalk.strct.net/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
A flexible calculator that supports variables and functions defined by the user

A command line calculator that supports math-like syntax with user-defined variables, functions, derivation, integration, and complex numbers.

>> f(x) = x(3x + 1) ← Declare functions >> a = 1/6 ← Declare variables >> 6ia√(f'(a))← Derivation 1.4142135624i ≈ √2i ← Complex numbers >> ∫(0, π, sin2ix, dx) + e^(πi) / 3 ← Integration -0.3333333333 + 133.3733807458i ≈ -1/3 + 133.3733807458i >> Σ(0, 720, 1/n!) ← Calculating sums 2.7182818285 ≈ e
Open a kalk session in a new tab

Features

  • Operators: +, -, *, /, !, %
  • Groups: (), ⌈⌉, ⌋⌊
  • Pre-defined functions and constants
  • User-defined functions and variables
  • Derivation (prime notation) and integration (eg. integral(a, b, x dx)
    The value of an integral is estimated using Simpson's 3/8 rule,
    while derivatives are estimated using the symmetric difference quotinent.
  • Complex numbers
  • Understands fairly ambiguous syntax. Eg. 2sinx + 2xy
  • Syntax highlighting
  • Completion for special symbols on tab
  • Sum function
  • Load a file including predefined functions and constants

Usage

All the calculator features and how they're used.

Operators


  • +, -, *, /
  • ! Factorial, eg. 5! gives 120
  • % Percent, eg. 5% gives 0.05, 10 + 50% gives 15
  • % Modulus (remainder), eg. 23 % 3 gives 2

Completion for special symbols


You can type special symbols (such as √) by typing the normal function or constant name and pressing tab.

  • sqrt becomes
  • deg becomes °
  • pi becomes π
  • sum becomes Σ()
  • integrate becomes ∫()
  • tau becomes τ
  • phi becomes ϕ
  • floor becomes ⌊⌋
  • ceil becomes ⌈⌉
  • gamma becomes Γ
  • ( becomes ()

Variables


Variables are defined with the following syntax: name = value

Examples: x = 3/4

Functions


Functions are defined with the following syntax: name(param1, param2, etc.) = value

Examples: f(x) = 2x+3 A(x, y) = (xy)/2

They are used like this: name(arg1, arg2, etc.)

Examples: f(3) + 3 A(2, 3)

Derivation can be done like this: name'(arg1)

Examples: f'(3) + 3 sin'(pi)

Predefined functions


  • sin, cos, tan, cot, cosec, sec
  • sinh, cosh, tanh, coth, cosech, sech
  • asin, acos, atan, acot, acosec, asec
  • asinh, acosh, atanh, acoth, acosech, asech
  • abs, ceil or ⌈⌉, floor or ⌊⌋, frac, round, trunc
  • sqrt or , cbrt, exp, log, ln, arg, Re, Im
  • gamma or Γ
  • asinh, acosh, atanh, acoth, acosech, asech
  • min, max, hypot
  • log Eg. log(1000, 10) is the same as log10(1000)
  • root Eg. root(16, 3) is the same as 3√16
  • integrate Eg. integrate(0, pi, sin(x) dx) is the same as
  • sum Eg. sum(1, 4, 2n) is the same as

Constants


pi or π = 3.14159265e = 2.71828182tau or τ = 6.2831853phi or ϕ = 1.61803398
Made by PaddiM8 - Hosted on Netlify

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK