AngouriMath
Equations
Method with 2 overloads
Equations(AngouriMath.Entity[])
Summary
Use it to solve systems of equationsParameter "equations"
Example
var system = MathS.Equations( "a + b", "a^2 - b + c" ); var solutions = system.Solve("a", "b"); Console.WriteLine(solutions.ToString(multilineFormat: true));
Console.WriteLine();
for (int i = 0; i < solutions.RowCount; i++) { var (a, b) = (solutions[i, 0], solutions[i, 1]); Console.WriteLine($"Solution #{i}: a = {a}, b = {b}"); }
Prints
Matrix[2 x 2] (-1 - sqrt(1 - 4 * c)) / 2 -(-1 - sqrt(1 - 4 * c)) / 2 (-1 + sqrt(1 - 4 * c)) / 2 -(-1 + sqrt(1 - 4 * c)) / 2
Solution #0: a = (-1 - sqrt(1 - 4 * c)) / 2, b = -(-1 - sqrt(1 - 4 * c)) / 2 Solution #1: a = (-1 + sqrt(1 - 4 * c)) / 2, b = -(-1 + sqrt(1 - 4 * c)) / 2Returns
An EquationSystem which can then be solvedEquations(System.Collections.Generic.IEnumerable{AngouriMath.Entity})
Summary
Use it to solve systems of equationsParameter "equations"
A sequence of Entity the system consists of
Example
var equations = LList.Of<Entity>( "a + b", "a^2 - b + c" ); var system = MathS.Equations(equations); var solutions = system.Solve("a", "b"); Console.WriteLine(solutions.ToString(multilineFormat: true));
Console.WriteLine();
for (int i = 0; i < solutions.RowCount; i++) { var (a, b) = (solutions[i, 0], solutions[i, 1]); Console.WriteLine($"Solution #{i}: a = {a}, b = {b}"); }
Prints
Matrix[2 x 2] (-1 - sqrt(1 - 4 * c)) / 2 -(-1 - sqrt(1 - 4 * c)) / 2 (-1 + sqrt(1 - 4 * c)) / 2 -(-1 + sqrt(1 - 4 * c)) / 2
Solution #0: a = (-1 - sqrt(1 - 4 * c)) / 2, b = -(-1 - sqrt(1 - 4 * c)) / 2 Solution #1: a = (-1 + sqrt(1 - 4 * c)) / 2, b = -(-1 + sqrt(1 - 4 * c)) / 2Returns
An EquationSystem which can then be solved
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online