This repo/crate provides a number of math utilities:
- parsing and evaluating expressions containing matrices and vectors
- solving equations
- exporting a LaTeX document from a collection of parsed expressions or solved equations
Precision:
Use feature high-prec for a precision of 13, standard precision is 8. The precision is used to solve equations. The actual output precision for printing is the defined precision - 2.
:warning: This repo/crate has not hit 1.0.0 yet, breaking changes are bound to happen!
Examples
Evaluations:
let res = quick_eval?;
assert_eq!;
let x = Variable ;
let res = quick_eval?;
assert_eq!;
let a = Variable ;
let res = quick_eval?;
assert_eq!;
let a = Variable ;
let b = Variable ;
let res = quick_eval?;
assert_eq!;
Equations:
let equation = "x^2=9".to_string;
let res = quick_solve?;
let res_rounded = res.iter.map.;
assert_eq!;
LaTeX:
let expression = "((25x^3-96x^2+512x+384)/(x^4+2x^3+90x^2-128x+1664)^(1.5))/(-sqrt(1-((32-x+x^2)/(((x-1)^2+25)(x^2+64)))^2))".to_string;
let parsed = parse?;
let vars = vec!;
let result = eval?;
let var_assign = Calc;
let step = Calc;
export;
Output (export-1.png):