calculi 0.2.0

A crate used to apply calculus functions on equations in string form
Documentation
  • Coverage
  • 17.14%
    6 out of 35 items documented1 out of 1 items with examples
  • Size
  • Source code size: 28.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.15 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Phiocto/calculi
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Phiocto

Calculi

'calculi' is a crate used to algebraically solve equations with unknown variables for a given outcome.

It is also able to solve equations when all unknown variables are given and perform other calculus functions.

Features

These are the current features of this crate (see Future Features for more info on future features).

  • Attempt to algebraically solve equations
  • Solve equations with given variables
  • Calculate derivatives (and supply them in string/component form)

Examples

let eq1 = calculi::Equation::new("x - 2 * a + 4 ^ b");

assert_eq!(eq1.solve_for(10.0, vec![("a", 4.5), ("b", 1.0)]).1, 15.0);


let eq2 = calculi::Equation::new("max(x + 3, root(y, 3), 1) + ln(exp(3))");

assert_eq!(eq2.solve_with(vec![("x", 2.0), ("y", 27.0)]).to_float().unwrap(), 8.0);


let eq3 = calculi::Equation::new("x ^ 3");

assert_eq!(eq3.derive().text, "3 * x ^ 2")

See the documentation for more info on how to use this crate and its functions.

Future Features

If you want to contribute these are some things you can contribute.

  • Calculate primitives (and supply them in string/component form)
  • Inverse functions
  • Possibly limits (when derivatives and integrals are implemented)
  • More calculus...

Fixing possible bugs, shortening code (without making it less efficient) or making it more efficient is of course always welcome.