calculi

Crates.iocalculi
lib.rscalculi
version0.2.0
sourcesrc
created_at2019-02-10 19:15:50.127372
updated_at2019-04-13 14:58:05.512176
descriptionA crate used to apply calculus functions on equations in string form
homepage
repositoryhttps://github.com/Phiocto/calculi
max_upload_size
id113945
size29,319
(Phiocto)

documentation

README

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.

Commit count: 3

cargo fmt