AngouriMath
Classes | Static Public Member Functions | Static Public Attributes | List of all members
AngouriMath.MathS Class Reference

Use functions from this class More...

Collaboration diagram for AngouriMath.MathS:
Collaboration graph
[legend]

Classes

class  Boolean
 Some operations on booleans are stored here
 
class  Compute
 Implements necessary functions for symbolic computation of limits, derivatives and integrals
 
class  DecimalConst
 Some non-symbolic constants
 
class  Diagnostic
 This class is used for diagnostic and debug of the library itself.
 
class  ExperimentalFeatures
 Features that might become stable in the future, but are not guaranteed to do anything useful or correctly at the current moment.
 
class  Hyperbolic
 Represents a few hyperbolic functions
 
class  Matrices
 Classes and functions related to matrices are defined here
 
class  Multithreading
 A few functions convenient to use in industrial projects to keep the system more reliable and distribute computations to other threads
 
class  Numbers
 
class  NumberTheory
 Use it in order to explore further number theory
 
class  Series
 That is a collection of some series, expressed in a symbolic form
 
class  Sets
 Functions and classes related to sets defined here
 
class  Settings
 A couple of settings allowing you to set some preferences for AM's algorithms To use these settings the syntax is
 
class  UnsafeAndInternal
 You may need it to manually manage some issues.
 
class  Utils
 Some additional functions that would be barely ever used by the user, but kept for "just in case" as public
 

Static Public Member Functions

static EquationSystem Equations (params Entity[] equations)
 Use it to solve systems of equations More...
 
static EquationSystem Equations (IEnumerable< Entity > equations)
 Use it to solve systems of equations More...
 
static Set SolveEquation (Entity equation, Variable var)
 Solves one equation over one variable More...
 
static Matrix SolveBooleanTable (Entity expression, params Variable[] variables)
 Solves a boolean expression. More...
 
static Entity Sin (Entity a)
  More...
 
static Entity Cos (Entity a)
  More...
 
static Entity Sec (Entity a)
  More...
 
static Entity Cosec (Entity a)
  More...
 
static Entity Log (Entity @base, Entity x)
  More...
 
static Entity Log (Entity x)
 This is 10-based logarithm. More...
 
static Entity Pow (Entity @base, Entity power)
  More...
 
static Entity Sqrt (Entity a)
 Special case of More...
 
static Entity Cbrt (Entity a)
 Special case of More...
 
static Entity Sqr (Entity a)
 Special case of More...
 
static Entity Tan (Entity a)
  More...
 
static Entity Cotan (Entity a)
  More...
 
static Entity Arcsin (Entity a)
  More...
 
static Entity Arccos (Entity a)
  More...
 
static Entity Arctan (Entity a)
  More...
 
static Entity Arccotan (Entity a)
  More...
 
static Entity Arcsec (Entity a)
  More...
 
static Entity Arccosec (Entity a)
  More...
 
static Entity Ln (Entity a)
 Is a special case of logarithm where the base equals e: More...
 
static Entity Factorial (Entity a)
  More...
 
static Entity Gamma (Entity a)
  More...
 
static Entity Signum (Entity a)
 https://en.wikipedia.org/wiki/Sign_function More...
 
static Entity Abs (Entity a)
 https://en.wikipedia.org/wiki/Absolute_value More...
 
static Entity Negation (Entity a)
 Boolean negation Wikipedia More...
 
static Entity Provided (Entity expression, Entity condition)
 This will be turned into expression if the condition is true, into NaN if condition is false, and remain the same otherwise More...
 
static Entity Piecewise (IEnumerable< Providedf > cases, Entity? otherwise=null)
 This is a piecewisely defined function, which turns into a particular definition once there exists a case number N such that case[N].Predicate is turned into true and for all i less than N : case[i].Predicate is turned into false. More...
 
static Entity Piecewise (params(Entity expression, Entity predicate)[] cases)
 This is a piecewisely defined function, which turns into a particular definition once there exists a case number N such that case[N].Predicate is turned into true and for all i less than N : case[i].Predicate is turned into false. More...
 
static Entity Apply (Entity expr, params Entity[] arguments)
 Applies the list of arguments to the given expression More...
 
static Entity Lambda (Variable param, Entity body)
 Returns a lambda with the given parameter and body More...
 
static Entity Disjunction (Entity a, Entity b)
 https://en.wikipedia.org/wiki/Logical_disjunction More...
 
static Entity Conjunction (Entity a, Entity b)
 https://en.wikipedia.org/wiki/Logical_conjunction More...
 
static Entity Implication (Entity assumption, Entity conclusion)
 https://en.wikipedia.org/wiki/Material_implication_(rule_of_inference) More...
 
static Entity ExclusiveDisjunction (Entity a, Entity b)
 https://en.wikipedia.org/wiki/Exclusive_or More...
 
static Entity Equality (Entity a, Entity b)
 Do NOT confuse it with Equation More...
 
static Entity GreaterThan (Entity a, Entity b)
 
Parameters
aLeft argument node of which the greater than node will be taken
bRight argument node of which the greater than node function will be taken
Returns
A node
More...
 
static Entity LessThan (Entity a, Entity b)
 
Parameters
aLeft argument node of which the less than node will be taken
bRight argument node of which the less than node function will be taken
Returns
A node
More...
 
static Entity GreaterOrEqualThan (Entity a, Entity b)
 
Parameters
aLeft argument node of which the greter than or equal node will be taken
bRight argument node of which the greater than or equal node function will be taken
Returns
A node
More...
 
static Entity LessOrEqualThan (Entity a, Entity b)
 
Parameters
aLeft argument node of which the less than or equal node will be taken
bRight argument node of which the less than or equal node function will be taken
Returns
A node
More...
 
static Set Union (Entity a, Entity b)
 
Parameters
aLeft argument node of which the union set node will be taken
bRight argument node of which the union set node will be taken
Returns
A node
More...
 
static Set Intersection (Entity a, Entity b)
 
Parameters
aLeft argument node of which the intersection set node will be taken
bRight argument node of which the intersection set node will be taken
Returns
A node
More...
 
static Set SetSubtraction (Entity a, Entity b)
 
Parameters
aLeft argument node of which the set subtraction node will be taken That is, the resulting set of set subtraction is necessarily superset of this set
bRight argument node of which the set subtraction set node will be taken That is, there is no element in the resulting set that belong to this one
Returns
A node
More...
 
static Variable Var (string name)
 Creates an instance of Variable. More...
 
static Entity FromString (string expr, bool useCache)
 Converts a string to an expression More...
 
static Entity FromString (string expr)
 Converts a string to an expression More...
 
static ParsingResult Parse (string source)
 Parses an expression silently, that is, without throwing an exception. More...
 
static string ToBaseN (Real num, int N)
 Translates a Number in base 10 into base N More...
 
static Number.Real FromBaseN (string num, int N)
 Translates a number in base N into base 10 More...
 
static string Latex (ILatexiseable latexiseable)
 
Returns
The LaTeX representation of the argument
Parameters
latexiseableAny element (Entity, Set, etc.) that can be represented in LaTeX
More...
 
static Entity Det (Matrix m)
 Finds the determinant of the given matrix. More...
 
static Matrix Matrix (Entity[,] values)
 Creates an instance of Entity.Matrix. More...
 
static Matrix Matrix (int rowCount, int colCount, Func< int, int, Entity > map)
 Creates an instance of matrix, where each cell's index is mapped to a value with the help of the mapping function. More...
 
static Matrix Vector (params Entity[] values)
 Creates an instance of Entity.Matrix that has one column. More...
 
static Matrix ZeroMatrix (int size)
 Creates a zero square matrix More...
 
static Matrix ZeroMatrix (int rowCount, int columnCount)
 Creates a zero square matrix More...
 
static Matrix ZeroVector (int size)
 Creates a zero vector More...
 
static Matrix Scalar (Entity value)
 Creates a 1x1 matrix of a given value. More...
 
static Matrix MatrixFromRows (IEnumerable< Matrix > vectors)
 Creates a matrix from given rows More...
 
static Matrix MatrixFromIEnum2x2 (IEnumerable< IEnumerable< Entity >> elements)
 Creates a matrix from given elements More...
 
static Interval Interval (Entity left, Entity right)
 Creates a closed interval (segment) More...
 
static Interval Interval (Entity left, bool leftClosed, Entity right, bool rightClosed)
 Creates an interval with custom endings More...
 
static Matrix IdentityMatrix (int size)
 Creates a square identity matrix More...
 
static Matrix IdentityMatrix (int rowCount, int columnCount)
 Creates a rectangular identity matrix with the given size More...
 
static bool TryPolynomial (Entity expr, Variable variable, [NotNullWhen(true)] out Entity? dst)
 Returns an Entity in polynomial order if possible More...
 
static string ToSympyCode (Entity expr)
 
Returns
sympy interpretable format
Parameters
exprAn Entity representing an expression
More...
 
static Entity Derivative (Entity expr, Entity var)
 Hangs your Entity to a derivative node (to evaluate instead use Compute.Derivative(Entity, Variable)) More...
 
static Entity Derivative (Entity expr, Entity var, int power)
 Hangs your Entity to a derivative node (to evaluate instead use Compute.Derivative(Entity, Variable)) More...
 
static Entity Integral (Entity expr, Entity var)
 Hangs your entity to an integral node (to evaluate instead use Compute.Integral(Entity, Variable)) More...
 
static Entity Integral (Entity expr, Entity var, Entity from, Entity to)
 Hangs your entity to an integral node (to evaluate instead use Compute.Integral(Entity, Variable)) More...
 
static Entity Limit (Entity expr, Entity var, Entity dest, ApproachFrom approach=ApproachFrom.BothSides)
 Hangs your entity to a limit node (to evaluate instead use Compute.Limit(Entity, Variable, Entity)) More...
 

Static Public Attributes

static Variable
 Creates two instances of Variable. More...
 
static readonly Real oo = (Real)(Entity)"+oo"
 Infinity. More...
 
static readonly Variable e = Variable.e
 The e constant More...
 
static readonly Complex i = Complex.ImaginaryOne
 The imaginary one More...
 
static readonly Variable pi = Variable.pi
 The pi constant More...
 
static readonly Entity NaN = Real.NaN
 NaN represents both "undefined" and "indeterminate". More...
 
static readonly Matrix I_1 = IdentityMatrix(1)
 The square identity matrix of size 1 More...
 
static readonly Matrix I_2 = IdentityMatrix(2)
 The square identity matrix of size 2 More...
 
static readonly Matrix I_3 = IdentityMatrix(3)
 The square identity matrix of size 3 More...
 
static readonly Matrix I_4 = IdentityMatrix(4)
 The square identity matrix of size 4 More...
 
static readonly Matrix O_1 = ZeroMatrix(1)
 The square zero matrix of size 1 More...
 
static readonly Matrix O_2 = ZeroMatrix(2)
 The square zero matrix of size 2 More...
 
static readonly Matrix O_3 = ZeroMatrix(3)
 The square zero matrix of size 3 More...
 
static readonly Matrix O_4 = ZeroMatrix(4)
 The square zero matrix of size 4 More...
 

Detailed Description

Use functions from this class

Member Function Documentation

◆ Abs()

static Entity AngouriMath.MathS.Abs ( Entity  a)
static

https://en.wikipedia.org/wiki/Absolute_value

Parameters
aArgument node of which Abs function will be taken
Returns
Abs node
using System;
using static AngouriMath.MathS;
Console.WriteLine(Abs(-5));
Console.WriteLine(Abs(-5).Evaled);
Console.WriteLine(Abs(0));
Console.WriteLine(Abs(0).Evaled);
Console.WriteLine(Abs(5));
Console.WriteLine(Abs(5).Evaled);
Console.WriteLine(Abs(4 + 3 * i));
Console.WriteLine(Abs(4 + 3 * i).Evaled);

Prints

abs(-5)
5
abs(0)
0
abs(5)
5
abs(4 + 3i)
5

◆ Apply()

static Entity AngouriMath.MathS.Apply ( Entity  expr,
params Entity []  arguments 
)
static

Applies the list of arguments to the given expression

Returns
Entity.Application
Entity expr = "sin";
Console.WriteLine(expr);
var applied = expr.Apply(pi / 3);
Console.WriteLine(applied);
Console.WriteLine(applied.Simplify());
Console.WriteLine(applied.Evaled);
Console.WriteLine("------------------------------");
var lambda = Lambda("x", "x ^ 3 + x");
Console.WriteLine(lambda);
Console.WriteLine(lambda.Apply("3"));
Console.WriteLine(lambda.Apply("3").Evaled);
Console.WriteLine("------------------------------");
var lambda2 = Lambda("y", "y".ToEntity().Apply(pi / 3));
Console.WriteLine(lambda2);
Console.WriteLine(lambda2.Apply("sin").Simplify());
Console.WriteLine(lambda2.Apply("cos").Simplify());
Console.WriteLine(lambda2.Apply("tan").Simplify());
Console.WriteLine("------------------------------");
var lambda3 = Lambda("x", Lambda("y", Lambda("z", "x + y / z")));
Console.WriteLine(lambda3);
Console.WriteLine(lambda3.Apply(5));
Console.WriteLine(lambda3.Apply(5).Simplify());
Console.WriteLine(lambda3.Apply(5).Apply(10));
Console.WriteLine(lambda3.Apply(5).Apply(10).Simplify());
Console.WriteLine(lambda3.Apply(5, 10));
Console.WriteLine(lambda3.Apply(5, 10).Simplify());
Console.WriteLine(lambda3.Apply(5, 10, 7));
Console.WriteLine(lambda3.Apply(5, 10, 7).Simplify());

Prints

sin
sin (pi / 3)
sqrt(3) / 2
<h2>1/2 * sqrt(3)
</h2>
x -> x ^ 3 + x
(x -> x ^ 3 + x) 3
<h2>30
</h2>
y -> y (pi / 3)
sqrt(3) / 2
1/2
<h2>sqrt(3)
</h2>
x -> y -> z -> x + y / z
(x -> y -> z -> x + y / z) 5
y -> z -> 5 + y / z
(x -> y -> z -> x + y / z) 5 10
z -> 5 + 10 / z
(x -> y -> z -> x + y / z) 5 10
z -> 5 + 10 / z
(x -> y -> z -> x + y / z) 5 10 7
45/7

◆ Arccos()

static Entity AngouriMath.MathS.Arccos ( Entity  a)
static

Parameters
aArgument node of which arccosine will be taken
Returns
Arccosine node
using System;
using static AngouriMath.MathS;
var expr = Arcsin("x") + Arccos("x");
Console.WriteLine(expr);
var expr2 = Arcsin(Sin("x")) + Arccos(Cos("y"));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());
var expr3 = Arctan(Sin("a") / Cos("a"));
Console.WriteLine(expr3);
Console.WriteLine(expr3.Simplify());
var expr4 = Arccotan(Cos("a") / Sin("a"));
Console.WriteLine(expr4);
Console.WriteLine(expr4.Simplify());
var expr5 = Arcsec(Sec("aa")) + Arccosec(Cosec("bb"));
Console.WriteLine(expr5);
Console.WriteLine(expr5.Simplify());

Prints

arcsin(x) + arccos(x)
arcsin(sin(x)) + arccos(cos(y))
x + y
arctan(sin(a) / cos(a))
a
arccotan(cos(a) / sin(a))
a
arcsec(sec(aa)) + arccsc(csc(bb))
aa + bb

◆ Arccosec()

static Entity AngouriMath.MathS.Arccosec ( Entity  a)
static

Parameters
aArgument node of which arccosecant will be taken
Returns
Arcsine node with the reciprocal of the argument
using System;
using static AngouriMath.MathS;
var expr = Arcsin("x") + Arccos("x");
Console.WriteLine(expr);
var expr2 = Arcsin(Sin("x")) + Arccos(Cos("y"));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());
var expr3 = Arctan(Sin("a") / Cos("a"));
Console.WriteLine(expr3);
Console.WriteLine(expr3.Simplify());
var expr4 = Arccotan(Cos("a") / Sin("a"));
Console.WriteLine(expr4);
Console.WriteLine(expr4.Simplify());
var expr5 = Arcsec(Sec("aa")) + Arccosec(Cosec("bb"));
Console.WriteLine(expr5);
Console.WriteLine(expr5.Simplify());

Prints

arcsin(x) + arccos(x)
arcsin(sin(x)) + arccos(cos(y))
x + y
arctan(sin(a) / cos(a))
a
arccotan(cos(a) / sin(a))
a
arcsec(sec(aa)) + arccsc(csc(bb))
aa + bb

◆ Arccotan()

static Entity AngouriMath.MathS.Arccotan ( Entity  a)
static

Parameters
aArgument node of which arccotangent will be taken
Returns
Arccotangent node
using System;
using static AngouriMath.MathS;
var expr = Arcsin("x") + Arccos("x");
Console.WriteLine(expr);
var expr2 = Arcsin(Sin("x")) + Arccos(Cos("y"));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());
var expr3 = Arctan(Sin("a") / Cos("a"));
Console.WriteLine(expr3);
Console.WriteLine(expr3.Simplify());
var expr4 = Arccotan(Cos("a") / Sin("a"));
Console.WriteLine(expr4);
Console.WriteLine(expr4.Simplify());
var expr5 = Arcsec(Sec("aa")) + Arccosec(Cosec("bb"));
Console.WriteLine(expr5);
Console.WriteLine(expr5.Simplify());

Prints

arcsin(x) + arccos(x)
arcsin(sin(x)) + arccos(cos(y))
x + y
arctan(sin(a) / cos(a))
a
arccotan(cos(a) / sin(a))
a
arcsec(sec(aa)) + arccsc(csc(bb))
aa + bb

◆ Arcsec()

static Entity AngouriMath.MathS.Arcsec ( Entity  a)
static

Parameters
aArgument node of which arcsecant will be taken
Returns
Arccosine node with the reciprocal of the argument
using System;
using static AngouriMath.MathS;
var expr = Arcsin("x") + Arccos("x");
Console.WriteLine(expr);
var expr2 = Arcsin(Sin("x")) + Arccos(Cos("y"));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());
var expr3 = Arctan(Sin("a") / Cos("a"));
Console.WriteLine(expr3);
Console.WriteLine(expr3.Simplify());
var expr4 = Arccotan(Cos("a") / Sin("a"));
Console.WriteLine(expr4);
Console.WriteLine(expr4.Simplify());
var expr5 = Arcsec(Sec("aa")) + Arccosec(Cosec("bb"));
Console.WriteLine(expr5);
Console.WriteLine(expr5.Simplify());

Prints

arcsin(x) + arccos(x)
arcsin(sin(x)) + arccos(cos(y))
x + y
arctan(sin(a) / cos(a))
a
arccotan(cos(a) / sin(a))
a
arcsec(sec(aa)) + arccsc(csc(bb))
aa + bb

◆ Arcsin()

static Entity AngouriMath.MathS.Arcsin ( Entity  a)
static

Parameters
aArgument node of which arcsine will be taken
Returns
Arcsine node
using System;
using static AngouriMath.MathS;
var expr = Arcsin("x") + Arccos("x");
Console.WriteLine(expr);
var expr2 = Arcsin(Sin("x")) + Arccos(Cos("y"));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());
var expr3 = Arctan(Sin("a") / Cos("a"));
Console.WriteLine(expr3);
Console.WriteLine(expr3.Simplify());
var expr4 = Arccotan(Cos("a") / Sin("a"));
Console.WriteLine(expr4);
Console.WriteLine(expr4.Simplify());
var expr5 = Arcsec(Sec("aa")) + Arccosec(Cosec("bb"));
Console.WriteLine(expr5);
Console.WriteLine(expr5.Simplify());

Prints

arcsin(x) + arccos(x)
arcsin(sin(x)) + arccos(cos(y))
x + y
arctan(sin(a) / cos(a))
a
arccotan(cos(a) / sin(a))
a
arcsec(sec(aa)) + arccsc(csc(bb))
aa + bb

◆ Arctan()

static Entity AngouriMath.MathS.Arctan ( Entity  a)
static

Parameters
aArgument node of which arctangent will be taken
Returns
Arctangent node
using System;
using static AngouriMath.MathS;
var expr = Arcsin("x") + Arccos("x");
Console.WriteLine(expr);
var expr2 = Arcsin(Sin("x")) + Arccos(Cos("y"));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());
var expr3 = Arctan(Sin("a") / Cos("a"));
Console.WriteLine(expr3);
Console.WriteLine(expr3.Simplify());
var expr4 = Arccotan(Cos("a") / Sin("a"));
Console.WriteLine(expr4);
Console.WriteLine(expr4.Simplify());
var expr5 = Arcsec(Sec("aa")) + Arccosec(Cosec("bb"));
Console.WriteLine(expr5);
Console.WriteLine(expr5.Simplify());

Prints

arcsin(x) + arccos(x)
arcsin(sin(x)) + arccos(cos(y))
x + y
arctan(sin(a) / cos(a))
a
arccotan(cos(a) / sin(a))
a
arcsec(sec(aa)) + arccsc(csc(bb))
aa + bb

◆ Cbrt()

static Entity AngouriMath.MathS.Cbrt ( Entity  a)
static

Special case of

Parameters
aThe argument of which cube root will be taken
Returns
Power node with (1/3) as the power
using System;
using static AngouriMath.MathS;
Console.WriteLine(Pow(2, 5));
Console.WriteLine(Pow(2, 5).Simplify());
Console.WriteLine(Pow(e, 2));
Console.WriteLine(Pow(e, 2).Simplify());
Console.WriteLine(Pow(e, 2).Evaled);
Console.WriteLine(Sqrt(Sqr("x")));
Console.WriteLine(Sqrt(Sqr("x")).Simplify());
Console.WriteLine(Pow(Cbrt("a"), 3));
Console.WriteLine(Pow(Cbrt("a"), 3).Simplify());
Console.WriteLine(Pow(Cbrt("a"), 6));
Console.WriteLine(Pow(Cbrt("a"), 6).Simplify());

Prints

2 ^ 5
32
e ^ 2
e ^ 2
7.389056098930650227230427460575007813180315570551847324087127822522573796079057763384312485079121792
sqrt(x ^ 2)
x
a ^ (1/3) ^ 3
a
a ^ (1/3) ^ 6
a ^ 2

◆ Conjunction()

static Entity AngouriMath.MathS.Conjunction ( Entity  a,
Entity  b 
)
static

https://en.wikipedia.org/wiki/Logical_conjunction

Parameters
aLeft argument node of which Conjunction function will be taken
bRight argument node of which Conjunction disjunction function will be taken
Returns
And node
using System;
using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
var myXor = Disjunction(Conjunction(x, Negation(y)), Conjunction(y, Negation(x)));
Console.WriteLine(myXor);
Console.WriteLine(MathS.Boolean.BuildTruthTable(myXor, x, y).ToString(multilineFormat: true));
Console.WriteLine("------------------");
var expr = ExclusiveDisjunction(Implication(x, y), Implication(y, x));
Console.WriteLine(expr);
Console.WriteLine("------------------");
var expr2 = Conjunction(x, Conjunction(x, y));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());

Prints

x and not y or y and not x
Matrix[4 x 3]
False False False
False True True
True False True
<h2>True True False
</h2>
<h2>(x implies y) xor (y implies x)
</h2>
x and x and y
x and y

◆ Cos()

static Entity AngouriMath.MathS.Cos ( Entity  a)
static

Parameters
aArgument node of cosine
Returns
Cosine node
using System;
using static AngouriMath.MathS;
var expr = Sin("x").Pow(2) + Cos("x").Pow(2);
Console.WriteLine(expr);
Console.WriteLine(expr.Simplify());

Prints

sin(x) ^ 2 + cos(x) ^ 2
1

◆ Cosec()

static Entity AngouriMath.MathS.Cosec ( Entity  a)
static

Parameters
aArgument node of cosecant
Returns
Cosecant node
using System;
using static AngouriMath.MathS;
var expr = Sec("x") / Cosec("x");
Console.WriteLine(expr);
Console.WriteLine(expr.Simplify());

Prints

sec(x) / csc(x)
tan(x)

◆ Cotan()

static Entity AngouriMath.MathS.Cotan ( Entity  a)
static

Parameters
aArgument node of which cotangent will be taken
Returns
Cotangent node
using System;
using static AngouriMath.MathS;
var expr = Tan("x") * Cotan("x");
Console.WriteLine(expr);
Console.WriteLine(expr.Simplify());
var expr2 = Tan("x") * Cos("x");
Console.WriteLine(expr2.Simplify());

Prints

tan(x) * cotan(x)
1
sin(x)

◆ Derivative() [1/2]

static Entity AngouriMath.MathS.Derivative ( Entity  expr,
Entity  var 
)
static

Hangs your Entity to a derivative node (to evaluate instead use Compute.Derivative(Entity, Variable))

Parameters
exprExpression to be hung
varVariable over which derivative is taken
using System;
using static AngouriMath.MathS;
var (x, a) = Var("x", "a");
var e1 = Derivative(Sin(Cos(x)), x);
Console.WriteLine(e1);
Console.WriteLine(e1.InnerSimplified);
Console.WriteLine("-----------------------");
var e2 = Derivative(Sin(Cos(x)), x, 2);
Console.WriteLine(e2);
Console.WriteLine(e2.InnerSimplified);
Console.WriteLine("-----------------------");
var e3 = Integral(Sin(a * x), x);
Console.WriteLine(e3);
Console.WriteLine(e3.InnerSimplified);
Console.WriteLine("-----------------------");
var e4 = Integral(Sin(a * x), x, 2);
Console.WriteLine(e4);
Console.WriteLine(e4.InnerSimplified);
Console.WriteLine("-----------------------");
var e5 = Limit(Sin(a * x) / x, x, 0);
Console.WriteLine(e5);
Console.WriteLine(e5.InnerSimplified);

Prints

derivative(sin(cos(x)), x)
<h2>cos(cos(x)) * -sin(x)
</h2>
derivative(sin(cos(x)), x, 2)
<h2>-sin(cos(x)) * -sin(x) * -sin(x) + cos(x) * (-1) * cos(cos(x))
</h2>
integral(sin(a * x), x)
<h2>-cos(a * x) / a
</h2>
integral(sin(a * x), x, 2)
<h2>-sin(a * x) / a / a
</h2>
limit(sin(a * x) / x, x, 0)
a

◆ Derivative() [2/2]

static Entity AngouriMath.MathS.Derivative ( Entity  expr,
Entity  var,
int  power 
)
static

Hangs your Entity to a derivative node (to evaluate instead use Compute.Derivative(Entity, Variable))

Parameters
exprExpression to be hung
varVariable over which derivative is taken
powerNumber of times derivative is taken. Only integers will be simplified or evaluated.
using System;
using static AngouriMath.MathS;
var (x, a) = Var("x", "a");
var e1 = Derivative(Sin(Cos(x)), x);
Console.WriteLine(e1);
Console.WriteLine(e1.InnerSimplified);
Console.WriteLine("-----------------------");
var e2 = Derivative(Sin(Cos(x)), x, 2);
Console.WriteLine(e2);
Console.WriteLine(e2.InnerSimplified);
Console.WriteLine("-----------------------");
var e3 = Integral(Sin(a * x), x);
Console.WriteLine(e3);
Console.WriteLine(e3.InnerSimplified);
Console.WriteLine("-----------------------");
var e4 = Integral(Sin(a * x), x, 2);
Console.WriteLine(e4);
Console.WriteLine(e4.InnerSimplified);
Console.WriteLine("-----------------------");
var e5 = Limit(Sin(a * x) / x, x, 0);
Console.WriteLine(e5);
Console.WriteLine(e5.InnerSimplified);

Prints

derivative(sin(cos(x)), x)
<h2>cos(cos(x)) * -sin(x)
</h2>
derivative(sin(cos(x)), x, 2)
<h2>-sin(cos(x)) * -sin(x) * -sin(x) + cos(x) * (-1) * cos(cos(x))
</h2>
integral(sin(a * x), x)
<h2>-cos(a * x) / a
</h2>
integral(sin(a * x), x, 2)
<h2>-sin(a * x) / a / a
</h2>
limit(sin(a * x) / x, x, 0)
a

◆ Det()

static Entity AngouriMath.MathS.Det ( Matrix  m)
static

Finds the determinant of the given matrix.

If the matrix is non-square, returns null

using System;
using static AngouriMath.Entity;
using static AngouriMath.MathS;
Matrix A = @"
[[1, 2],
[3, 4]]
";
Console.WriteLine(Det(A));
Matrix B = @"
[[1, 2],
[3, 6]]
";
Console.WriteLine(Det(B));
Matrix C = @"
[[1, 2],
[3, 6],
[7, 8]]
";
Console.WriteLine(Det(C) is null);

Prints

-2
0
True

◆ Disjunction()

static Entity AngouriMath.MathS.Disjunction ( Entity  a,
Entity  b 
)
static

https://en.wikipedia.org/wiki/Logical_disjunction

Parameters
aThe left argument node of which Disjunction function will be taken
bThe right argument node of which Disjunction function will be taken
Returns
Or node
using System;
using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
var myXor = Disjunction(Conjunction(x, Negation(y)), Conjunction(y, Negation(x)));
Console.WriteLine(myXor);
Console.WriteLine(MathS.Boolean.BuildTruthTable(myXor, x, y).ToString(multilineFormat: true));
Console.WriteLine("------------------");
var expr = ExclusiveDisjunction(Implication(x, y), Implication(y, x));
Console.WriteLine(expr);
Console.WriteLine("------------------");
var expr2 = Conjunction(x, Conjunction(x, y));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());

Prints

x and not y or y and not x
Matrix[4 x 3]
False False False
False True True
True False True
<h2>True True False
</h2>
<h2>(x implies y) xor (y implies x)
</h2>
x and x and y
x and y

◆ Equality()

static Entity AngouriMath.MathS.Equality ( Entity  a,
Entity  b 
)
static

Do NOT confuse it with Equation

Parameters
aLeft argument node of which Equality function will be taken
bRight argument node of which Equality disjunction function will be taken
Returns
An Equals node
using System;
using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
var equation = Equality(Sqrt(x), 4 * x - 3);
Console.WriteLine(equation);
Console.WriteLine(equation.Solve(x));
Console.WriteLine("----------------------");
var statement1 = Equality(5, 10);
Console.WriteLine(statement1);
Console.WriteLine((bool)statement1.EvalBoolean());
Console.WriteLine("----------------------");
var statement2 = Equality(5, 5);
Console.WriteLine(statement2);
Console.WriteLine((bool)statement2.EvalBoolean());
Console.WriteLine("----------------------");
var statement3 = Equality(x, y);
Console.WriteLine(statement3);
Console.WriteLine(statement3.Simplify());
// throws here!
Console.WriteLine((bool)statement3.EvalBoolean());

Prints

sqrt(x) = 4 * x - 3
<h2>{ 9/16, 1 }
</h2>
5 = 10
<h2>False
</h2>
5 = 5
<h2>True
</h2>
x = y
x = y

◆ Equations() [1/2]

static EquationSystem AngouriMath.MathS.Equations ( params Entity []  equations)
static

Use it to solve systems of equations

Parameters
equationsAn array of Entity (or strings) the system consists of
var system = MathS.Equations(
"a + b",
"a^2 - b + c"
);
var solutions = system.Solve("a", "b");
Console.WriteLine(solutions.ToString(multilineFormat: true));
<br/>
Console.WriteLine();
<br/>
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
<br/>
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)) / 2
Returns
An EquationSystem which can then be solved

◆ Equations() [2/2]

static EquationSystem AngouriMath.MathS.Equations ( IEnumerable< Entity equations)
static

Use it to solve systems of equations

Parameters
equationsA sequence of Entity the system consists of
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));
<br/>
Console.WriteLine();
<br/>
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
<br/>
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)) / 2
Returns
An EquationSystem which can then be solved

◆ ExclusiveDisjunction()

static Entity AngouriMath.MathS.ExclusiveDisjunction ( Entity  a,
Entity  b 
)
static

https://en.wikipedia.org/wiki/Exclusive_or

Parameters
aLeft argument node of which Exclusive disjunction function will be taken
bRight argument node of which Exclusive disjunction function will be taken
Returns
Xor node
using System;
using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
var myXor = Disjunction(Conjunction(x, Negation(y)), Conjunction(y, Negation(x)));
Console.WriteLine(myXor);
Console.WriteLine(MathS.Boolean.BuildTruthTable(myXor, x, y).ToString(multilineFormat: true));
Console.WriteLine("------------------");
var expr = ExclusiveDisjunction(Implication(x, y), Implication(y, x));
Console.WriteLine(expr);
Console.WriteLine("------------------");
var expr2 = Conjunction(x, Conjunction(x, y));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());

Prints

x and not y or y and not x
Matrix[4 x 3]
False False False
False True True
True False True
<h2>True True False
</h2>
<h2>(x implies y) xor (y implies x)
</h2>
x and x and y
x and y

◆ Factorial()

static Entity AngouriMath.MathS.Factorial ( Entity  a)
static

Parameters
aArgument node of which factorial will be taken
Returns
Factorial node
using System;
using static AngouriMath.MathS;
var expr = Factorial(5);
Console.WriteLine(expr);
Console.WriteLine(expr.Evaled);
var expr2 = Gamma(4);
Console.WriteLine(expr2);
Console.WriteLine(expr2.Evaled);

Prints

5!
120
(4 + 1)!
120

◆ FromBaseN()

static Number.Real AngouriMath.MathS.FromBaseN ( string  num,
int  N 
)
static

Translates a number in base N into base 10

Parameters
numA Real in base N to be translated into base 10
NThe base to translate the number from
Returns
The Real in base 10
using System;
using static AngouriMath.MathS;
using var _ = Settings.DowncastingEnabled.Set(false);
Console.WriteLine(ToBaseN(1.5m, 2));
Console.WriteLine(ToBaseN(3.75m, 2));
Console.WriteLine(ToBaseN(13.125m, 2));
Console.WriteLine(ToBaseN(13.125m, 10));
// uncomment when https://github.com/asc-community/AngouriMath/issues/584
// is fixed
// Console.WriteLine(ToBaseN(13.125m, 5));
Console.WriteLine(ToBaseN(13.125m, 8));
Console.WriteLine("-----------------------");
Console.WriteLine(FromBaseN("FF", 16));
Console.WriteLine(FromBaseN("77", 8));
Console.WriteLine(FromBaseN("1.1", 2));
Console.WriteLine(FromBaseN("1.01", 2));
Console.WriteLine(FromBaseN("1.05", 6));

Prints

1.1
11.11
1101.001
13.125
<h2>15.1
</h2>
255
63
1.500000000
1.250000000
1.138888888

◆ FromString() [1/2]

static Entity AngouriMath.MathS.FromString ( string  expr,
bool  useCache 
)
static

Converts a string to an expression

Parameters
exprstring expression, for example,
"2 * x + 3 + sqrt(x)"
useCacheBy default is true, it boosts performance if you have multiple uses of the same string, for example, Entity expr = (Entity)"+oo" + "x".Limit("x", "+oo") * "+oo"; First occurance will be parsed, others will be replaced with the cached entity
Returns
The parsed expression

Multiple ways to parse an expression.

Entity expr1 = "a + b";
var expr2 = FromString("a + b");
var expr3 = FromString("a + b", useCache: false);
var expr4 = (Entity)"a + b";
var expr5 = Parse("a + b").Switch(
res => res,
failure => failure.Reason.Switch<object>(
unknown => throw new("Unknown reason"),
missingOp => throw new("Missing operator"),
internalError => throw new("Internal error")
)
);

◆ FromString() [2/2]

static Entity AngouriMath.MathS.FromString ( string  expr)
static

Converts a string to an expression

Parameters
exprstring expression, for example,
"2 * x + 3 + sqrt(x)"
Returns
The parsed expression

Multiple ways to parse an expression.

Entity expr1 = "a + b";
var expr2 = FromString("a + b");
var expr3 = FromString("a + b", useCache: false);
var expr4 = (Entity)"a + b";
var expr5 = Parse("a + b").Switch(
res => res,
failure => failure.Reason.Switch<object>(
unknown => throw new("Unknown reason"),
missingOp => throw new("Missing operator"),
internalError => throw new("Internal error")
)
);

◆ Gamma()

static Entity AngouriMath.MathS.Gamma ( Entity  a)
static

Parameters
aArgument node of which gamma function will be taken
Returns
Factorial node with one subtracted from the argument
using System;
using static AngouriMath.MathS;
var expr = Factorial(5);
Console.WriteLine(expr);
Console.WriteLine(expr.Evaled);
var expr2 = Gamma(6);
Console.WriteLine(expr2);
Console.WriteLine(expr2.Evaled);

Prints

5!
120
(6 - 1)!
120

◆ GreaterOrEqualThan()

static Entity AngouriMath.MathS.GreaterOrEqualThan ( Entity  a,
Entity  b 
)
static

Parameters
aLeft argument node of which the greter than or equal node will be taken
bRight argument node of which the greater than or equal node function will be taken
Returns
A node

using System; using static AngouriMath.MathS;

var (x, y) = Var("x", "y");

Console.WriteLine(GreaterThan(x, y)); Console.WriteLine(GreaterThan(6, 5)); Console.WriteLine(GreaterThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessThan(x, y)); Console.WriteLine(LessThan(6, 5)); Console.WriteLine(LessThan(6, 5).EvalBoolean()); Console.WriteLine(LessThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(GreaterOrEqualThan(x, y)); Console.WriteLine(GreaterOrEqualThan(6, 5)); Console.WriteLine(GreaterOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessOrEqualThan(x, y)); Console.WriteLine(LessOrEqualThan(6, 5)); Console.WriteLine(LessOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(LessOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); var statement1 = GreaterThan(Sqr(x), 5); Console.WriteLine(statement1); Console.WriteLine(statement1.Solve("x")); Console.WriteLine("----------------------------------"); var statement2 = GreaterThan(Sqr(x), 16) & LessThan(x, y); Console.WriteLine(statement2); Console.WriteLine(statement2.Solve("x")); Console.WriteLine("----------------------------------"); var statement3 = LessThan(Sqr(x), 16) & GreaterThan(x, 2); Console.WriteLine(statement3); Console.WriteLine(statement3.Solve("x")); Prints x > y 6 > 5 True

False

x < y 6 < 5 False

False

x >= y 6 >= 5 True

True

x <= y 6 <= 5 False

True

x ^ 2 > 5

(-oo; -sqrt(20) / 2) \/ (sqrt(20) / 2; +oo)

x ^ 2 > 16 and x < y

((-oo; -4) \/ (4; +oo)) /\ (-oo; -y / (-1))

x ^ 2 < 16 and x > 2 (2; 4)

◆ GreaterThan()

static Entity AngouriMath.MathS.GreaterThan ( Entity  a,
Entity  b 
)
static

Parameters
aLeft argument node of which the greater than node will be taken
bRight argument node of which the greater than node function will be taken
Returns
A node

using System; using static AngouriMath.MathS;

var (x, y) = Var("x", "y");

Console.WriteLine(GreaterThan(x, y)); Console.WriteLine(GreaterThan(6, 5)); Console.WriteLine(GreaterThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessThan(x, y)); Console.WriteLine(LessThan(6, 5)); Console.WriteLine(LessThan(6, 5).EvalBoolean()); Console.WriteLine(LessThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(GreaterOrEqualThan(x, y)); Console.WriteLine(GreaterOrEqualThan(6, 5)); Console.WriteLine(GreaterOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessOrEqualThan(x, y)); Console.WriteLine(LessOrEqualThan(6, 5)); Console.WriteLine(LessOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(LessOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); var statement1 = GreaterThan(Sqr(x), 5); Console.WriteLine(statement1); Console.WriteLine(statement1.Solve("x")); Console.WriteLine("----------------------------------"); var statement2 = GreaterThan(Sqr(x), 16) & LessThan(x, y); Console.WriteLine(statement2); Console.WriteLine(statement2.Solve("x")); Console.WriteLine("----------------------------------"); var statement3 = LessThan(Sqr(x), 16) & GreaterThan(x, 2); Console.WriteLine(statement3); Console.WriteLine(statement3.Solve("x")); Prints x > y 6 > 5 True

False

x < y 6 < 5 False

False

x >= y 6 >= 5 True

True

x <= y 6 <= 5 False

True

x ^ 2 > 5

(-oo; -sqrt(20) / 2) \/ (sqrt(20) / 2; +oo)

x ^ 2 > 16 and x < y

((-oo; -4) \/ (4; +oo)) /\ (-oo; -y / (-1))

x ^ 2 < 16 and x > 2 (2; 4)

◆ IdentityMatrix() [1/2]

static Matrix AngouriMath.MathS.IdentityMatrix ( int  size)
static

Creates a square identity matrix

using System;
using static AngouriMath.MathS;
Console.WriteLine(IdentityMatrix(4).ToString(multilineFormat: true));
Console.WriteLine(IdentityMatrix(4, 3).ToString(multilineFormat: true));

Prints

Matrix[4 x 4]
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
Matrix[4 x 3]
1 0 0
0 1 0
0 0 1
0 0 0

◆ IdentityMatrix() [2/2]

static Matrix AngouriMath.MathS.IdentityMatrix ( int  rowCount,
int  columnCount 
)
static

Creates a rectangular identity matrix with the given size

using System;
using static AngouriMath.MathS;
Console.WriteLine(IdentityMatrix(4).ToString(multilineFormat: true));
Console.WriteLine(IdentityMatrix(4, 3).ToString(multilineFormat: true));

Prints

Matrix[4 x 4]
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
Matrix[4 x 3]
1 0 0
0 1 0
0 0 1
0 0 0

◆ Implication()

static Entity AngouriMath.MathS.Implication ( Entity  assumption,
Entity  conclusion 
)
static

https://en.wikipedia.org/wiki/Material_implication_(rule_of_inference)

Parameters
assumptionThe assumption node
conclusionThe conclusion node
Returns
Implies node
using System;
using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
var myXor = Disjunction(Conjunction(x, Negation(y)), Conjunction(y, Negation(x)));
Console.WriteLine(myXor);
Console.WriteLine(MathS.Boolean.BuildTruthTable(myXor, x, y).ToString(multilineFormat: true));
Console.WriteLine("------------------");
var expr = ExclusiveDisjunction(Implication(x, y), Implication(y, x));
Console.WriteLine(expr);
Console.WriteLine("------------------");
var expr2 = Conjunction(x, Conjunction(x, y));
Console.WriteLine(expr2);
Console.WriteLine(expr2.Simplify());

Prints

x and not y or y and not x
Matrix[4 x 3]
False False False
False True True
True False True
<h2>True True False
</h2>
<h2>(x implies y) xor (y implies x)
</h2>
x and x and y
x and y

◆ Integral() [1/2]

static Entity AngouriMath.MathS.Integral ( Entity  expr,
Entity  var 
)
static

Hangs your entity to an integral node (to evaluate instead use Compute.Integral(Entity, Variable))

Parameters
exprExpression to be hung
varVariable over which integral is taken
using System;
using static AngouriMath.MathS;
var (x, a) = Var("x", "a");
var e1 = Derivative(Sin(Cos(x)), x);
Console.WriteLine(e1);
Console.WriteLine(e1.InnerSimplified);
Console.WriteLine("-----------------------");
var e2 = Derivative(Sin(Cos(x)), x, 2);
Console.WriteLine(e2);
Console.WriteLine(e2.InnerSimplified);
Console.WriteLine("-----------------------");
var e3 = Integral(Sin(a * x), x);
Console.WriteLine(e3);
Console.WriteLine(e3.InnerSimplified);
Console.WriteLine("-----------------------");
var e4 = Integral(Sin(a * x), x, 2);
Console.WriteLine(e4);
Console.WriteLine(e4.InnerSimplified);
Console.WriteLine("-----------------------");
var e5 = Limit(Sin(a * x) / x, x, 0);
Console.WriteLine(e5);
Console.WriteLine(e5.InnerSimplified);

Prints

derivative(sin(cos(x)), x)
<h2>cos(cos(x)) * -sin(x)
</h2>
derivative(sin(cos(x)), x, 2)
<h2>-sin(cos(x)) * -sin(x) * -sin(x) + cos(x) * (-1) * cos(cos(x))
</h2>
integral(sin(a * x), x)
<h2>-cos(a * x) / a
</h2>
integral(sin(a * x), x, 2)
<h2>-sin(a * x) / a / a
</h2>
limit(sin(a * x) / x, x, 0)
a

◆ Integral() [2/2]

static Entity AngouriMath.MathS.Integral ( Entity  expr,
Entity  var,
Entity  from,
Entity  to 
)
static

Hangs your entity to an integral node (to evaluate instead use Compute.Integral(Entity, Variable))

Parameters
exprExpression to be hung
varVariable over which integral is taken
fromThe lower bound for integrating
toThe upper bound for integrating
using System;
using static AngouriMath.MathS;
var (x, a) = Var("x", "a");
var e1 = Derivative(Sin(Cos(x)), x);
Console.WriteLine(e1);
Console.WriteLine(e1.InnerSimplified);
Console.WriteLine("-----------------------");
var e2 = Derivative(Sin(Cos(x)), x, 2);
Console.WriteLine(e2);
Console.WriteLine(e2.InnerSimplified);
Console.WriteLine("-----------------------");
var e3 = Integral(Sin(a * x), x);
Console.WriteLine(e3);
Console.WriteLine(e3.InnerSimplified);
Console.WriteLine("-----------------------");
var e4 = Integral(Sin(a * x), x, 2);
Console.WriteLine(e4);
Console.WriteLine(e4.InnerSimplified);
Console.WriteLine("-----------------------");
var e5 = Limit(Sin(a * x) / x, x, 0);
Console.WriteLine(e5);
Console.WriteLine(e5.InnerSimplified);

Prints

derivative(sin(cos(x)), x)
<h2>cos(cos(x)) * -sin(x)
</h2>
derivative(sin(cos(x)), x, 2)
<h2>-sin(cos(x)) * -sin(x) * -sin(x) + cos(x) * (-1) * cos(cos(x))
</h2>
integral(sin(a * x), x)
<h2>-cos(a * x) / a
</h2>
integral(sin(a * x), x, 2)
<h2>-sin(a * x) / a / a
</h2>
limit(sin(a * x) / x, x, 0)
a

◆ Intersection()

static Set AngouriMath.MathS.Intersection ( Entity  a,
Entity  b 
)
static

Parameters
aLeft argument node of which the intersection set node will be taken
bRight argument node of which the intersection set node will be taken
Returns
A node

using AngouriMath; using System; using static AngouriMath.Entity.Set; using static AngouriMath.MathS; using static AngouriMath.MathS.Sets;

var set1 = Finite(1, 2, 3); var set2 = Finite(2, 3, 4); var set3 = MathS.Interval(-6, 2); var set4 = new ConditionalSet("x", "100 &gt; x2 &gt; 81"); Console.WriteLine(Union(set1, set2)); Console.WriteLine(Union(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set3)); Console.WriteLine(Union(set1, set3).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set4)); Console.WriteLine(ElementInSet(3, Union(set1, set4))); Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(4, Union(set1, set4))); Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(9.5, Union(set1, set4))); Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set1, set2)); Console.WriteLine(Intersection(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set2, set3)); Console.WriteLine(Intersection(set2, set3).Simplify()); Console.WriteLine("----------------------"); var set5 = MathS.Interval(-3, 11); Console.WriteLine(Intersection(set3, set5)); Console.WriteLine(Intersection(set3, set5).Simplify()); Console.WriteLine(Union(set3, set5)); Console.WriteLine(Union(set3, set5).Simplify()); Console.WriteLine(SetSubtraction(set3, set5)); Console.WriteLine(SetSubtraction(set3, set5).Simplify()); Console.WriteLine("----------------------"); Entity syntax1 = "{ 1, 2, 3 } /\ { 2, 3, 4 }"; Console.WriteLine(syntax1); Console.WriteLine(syntax1.Simplify()); Console.WriteLine("----------------------"); Entity syntax2 = "5 in ([1; +oo) \/ { x : x < -4 })"; Console.WriteLine(syntax2); Console.WriteLine(syntax2.Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify()); Prints { 1, 2, 3 } \/ { 2, 3, 4 }

{ 1, 2, 3, 4 }

{ 1, 2, 3 } \/ [-6; 2]

{ 3 } \/ [-6; 2]

{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } 3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True 4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } False 19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }

True

{ 1, 2, 3 } /\ { 2, 3, 4 }

{ 2, 3 }

{ 2, 3, 4 } /\ [-6; 2]

{ 2 }

[-6; 2] /\ [-3; 11] [-3; 2] [-6; 2] \/ [-3; 11] [-6; 11] [-6; 2] \ [-3; 11]

[-6; -3)

{ 1, 2, 3 } /\ { 2, 3, 4 }

{ 2, 3 }

5 in [1; +oo) \/ { x : x < -4 }

True

{ pi, e, 6, 11/2, 1 + 3i } /\ QQ { 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ RR { pi, e, 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ CC { pi, e, 6, 11/2, 1 + 3i }

◆ Interval() [1/2]

static Interval AngouriMath.MathS.Interval ( Entity  left,
Entity  right 
)
static

Creates a closed interval (segment)

using System;
using static AngouriMath.Entity.Set;
using static AngouriMath.MathS;
using static AngouriMath.MathS.Sets;
var set1 = Finite(1, 2, 3);
var set2 = Finite(2, 3, 4);
var set3 = MathS.Interval(-6, 2);
var set4 = new ConditionalSet("x", "100 > x2 > 81");
Console.WriteLine(Union(set1, set2));
Console.WriteLine(Union(set1, set2).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Union(set1, set3));
Console.WriteLine(Union(set1, set3).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Union(set1, set4));
Console.WriteLine(ElementInSet(3, Union(set1, set4)));
Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify());
Console.WriteLine(ElementInSet(4, Union(set1, set4)));
Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify());
Console.WriteLine(ElementInSet(9.5, Union(set1, set4)));
Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(set1, set2));
Console.WriteLine(Intersection(set1, set2).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(set2, set3));
Console.WriteLine(Intersection(set2, set3).Simplify());
Console.WriteLine("----------------------");
var set5 = MathS.Interval(-3, 11);
Console.WriteLine(Intersection(set3, set5));
Console.WriteLine(Intersection(set3, set5).Simplify());
Console.WriteLine(Union(set3, set5));
Console.WriteLine(Union(set3, set5).Simplify());
Console.WriteLine(SetSubtraction(set3, set5));
Console.WriteLine(SetSubtraction(set3, set5).Simplify());
Console.WriteLine("----------------------");
Entity syntax1 = @"{ 1, 2, 3 } /\ { 2, 3, 4 }";
Console.WriteLine(syntax1);
Console.WriteLine(syntax1.Simplify());
Console.WriteLine("----------------------");
Entity syntax2 = @"5 in ([1; +oo) \/ { x : x < -4 })";
Console.WriteLine(syntax2);
Console.WriteLine(syntax2.Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify());
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify());
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify());

Prints

{ 1, 2, 3 } \/ { 2, 3, 4 }
<h2>{ 1, 2, 3, 4 }
</h2>
{ 1, 2, 3 } \/ [-6; 2]
<h2>{ 3 } \/ [-6; 2]
</h2>
{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
True
4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
False
19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
<h2>True
</h2>
{ 1, 2, 3 } /\ { 2, 3, 4 }
<h2>{ 2, 3 }
</h2>
{ 2, 3, 4 } /\ [-6; 2]
<h2>{ 2 }
</h2>
[-6; 2] /\ [-3; 11]
[-3; 2]
[-6; 2] \/ [-3; 11]
[-6; 11]
[-6; 2] \ [-3; 11]
<h2>[-6; -3)
</h2>
{ 1, 2, 3 } /\ { 2, 3, 4 }
<h2>{ 2, 3 }
</h2>
5 in [1; +oo) \/ { x : x < -4 }
<h2>True
</h2>
{ pi, e, 6, 11/2, 1 + 3i } /\ QQ
{ 6, 11/2 }
{ pi, e, 6, 11/2, 1 + 3i } /\ RR
{ pi, e, 6, 11/2 }
{ pi, e, 6, 11/2, 1 + 3i } /\ CC
{ pi, e, 6, 11/2, 1 + 3i }

◆ Interval() [2/2]

static Interval AngouriMath.MathS.Interval ( Entity  left,
bool  leftClosed,
Entity  right,
bool  rightClosed 
)
static

Creates an interval with custom endings

using System;
using static AngouriMath.Entity.Set;
using static AngouriMath.MathS;
using static AngouriMath.MathS.Sets;
var set1 = Finite(1, 2, 3);
var set2 = Finite(2, 3, 4);
var set3 = MathS.Interval(-6, 2);
var set4 = new ConditionalSet("x", "100 > x2 > 81");
Console.WriteLine(Union(set1, set2));
Console.WriteLine(Union(set1, set2).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Union(set1, set3));
Console.WriteLine(Union(set1, set3).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Union(set1, set4));
Console.WriteLine(ElementInSet(3, Union(set1, set4)));
Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify());
Console.WriteLine(ElementInSet(4, Union(set1, set4)));
Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify());
Console.WriteLine(ElementInSet(9.5, Union(set1, set4)));
Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(set1, set2));
Console.WriteLine(Intersection(set1, set2).Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(set2, set3));
Console.WriteLine(Intersection(set2, set3).Simplify());
Console.WriteLine("----------------------");
var set5 = MathS.Interval(-3, 11);
Console.WriteLine(Intersection(set3, set5));
Console.WriteLine(Intersection(set3, set5).Simplify());
Console.WriteLine(Union(set3, set5));
Console.WriteLine(Union(set3, set5).Simplify());
Console.WriteLine(SetSubtraction(set3, set5));
Console.WriteLine(SetSubtraction(set3, set5).Simplify());
Console.WriteLine("----------------------");
Entity syntax1 = @"{ 1, 2, 3 } /\ { 2, 3, 4 }";
Console.WriteLine(syntax1);
Console.WriteLine(syntax1.Simplify());
Console.WriteLine("----------------------");
Entity syntax2 = @"5 in ([1; +oo) \/ { x : x < -4 })";
Console.WriteLine(syntax2);
Console.WriteLine(syntax2.Simplify());
Console.WriteLine("----------------------");
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify());
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify());
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C));
Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify());

Prints

{ 1, 2, 3 } \/ { 2, 3, 4 }
<h2>{ 1, 2, 3, 4 }
</h2>
{ 1, 2, 3 } \/ [-6; 2]
<h2>{ 3 } \/ [-6; 2]
</h2>
{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
True
4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
False
19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
<h2>True
</h2>
{ 1, 2, 3 } /\ { 2, 3, 4 }
<h2>{ 2, 3 }
</h2>
{ 2, 3, 4 } /\ [-6; 2]
<h2>{ 2 }
</h2>
[-6; 2] /\ [-3; 11]
[-3; 2]
[-6; 2] \/ [-3; 11]
[-6; 11]
[-6; 2] \ [-3; 11]
<h2>[-6; -3)
</h2>
{ 1, 2, 3 } /\ { 2, 3, 4 }
<h2>{ 2, 3 }
</h2>
5 in [1; +oo) \/ { x : x < -4 }
<h2>True
</h2>
{ pi, e, 6, 11/2, 1 + 3i } /\ QQ
{ 6, 11/2 }
{ pi, e, 6, 11/2, 1 + 3i } /\ RR
{ pi, e, 6, 11/2 }
{ pi, e, 6, 11/2, 1 + 3i } /\ CC
{ pi, e, 6, 11/2, 1 + 3i }

◆ Lambda()

static Entity AngouriMath.MathS.Lambda ( Variable  param,
Entity  body 
)
static

Returns a lambda with the given parameter and body

Entity expr = "sin";
Console.WriteLine(expr);
var applied = expr.Apply(pi / 3);
Console.WriteLine(applied);
Console.WriteLine(applied.Simplify());
Console.WriteLine(applied.Evaled);
Console.WriteLine("------------------------------");
var lambda = Lambda("x", "x ^ 3 + x");
Console.WriteLine(lambda);
Console.WriteLine(lambda.Apply("3"));
Console.WriteLine(lambda.Apply("3").Evaled);
Console.WriteLine("------------------------------");
var lambda2 = Lambda("y", "y".ToEntity().Apply(pi / 3));
Console.WriteLine(lambda2);
Console.WriteLine(lambda2.Apply("sin").Simplify());
Console.WriteLine(lambda2.Apply("cos").Simplify());
Console.WriteLine(lambda2.Apply("tan").Simplify());
Console.WriteLine("------------------------------");
var lambda3 = Lambda("x", Lambda("y", Lambda("z", "x + y / z")));
Console.WriteLine(lambda3);
Console.WriteLine(lambda3.Apply(5));
Console.WriteLine(lambda3.Apply(5).Simplify());
Console.WriteLine(lambda3.Apply(5).Apply(10));
Console.WriteLine(lambda3.Apply(5).Apply(10).Simplify());
Console.WriteLine(lambda3.Apply(5, 10));
Console.WriteLine(lambda3.Apply(5, 10).Simplify());
Console.WriteLine(lambda3.Apply(5, 10, 7));
Console.WriteLine(lambda3.Apply(5, 10, 7).Simplify());

Prints

sin
sin (pi / 3)
sqrt(3) / 2
<h2>1/2 * sqrt(3)
</h2>
x -> x ^ 3 + x
(x -> x ^ 3 + x) 3
<h2>30
</h2>
y -> y (pi / 3)
sqrt(3) / 2
1/2
<h2>sqrt(3)
</h2>
x -> y -> z -> x + y / z
(x -> y -> z -> x + y / z) 5
y -> z -> 5 + y / z
(x -> y -> z -> x + y / z) 5 10
z -> 5 + 10 / z
(x -> y -> z -> x + y / z) 5 10
z -> 5 + 10 / z
(x -> y -> z -> x + y / z) 5 10 7
45/7

◆ Latex()

static string AngouriMath.MathS.Latex ( ILatexiseable  latexiseable)
static

Returns
The LaTeX representation of the argument
Parameters
latexiseableAny element (Entity, Set, etc.) that can be represented in LaTeX

using System; using AngouriMath; using static AngouriMath.MathS;

Entity expr = "sqrt(a) + integral(sin(x), x)"; Console.WriteLine(expr); Console.WriteLine(Latex(expr)); Entity expr2 = "a / b ^ limit(sin(x) - cosh(y), x, +oo)"; Console.WriteLine(expr2); Console.WriteLine(Latex(expr2)); Prints sqrt(a) + integral(sin(x), x) {a}+ [(x)] dx a / b ^ limit(sin(x) - (e ^ y + e ^ (-y)) / 2, x, +oo) {a}{{b}^{{x } [(x)-{{e}^{y}+{e}^{-y}}{2}]}}

◆ LessOrEqualThan()

static Entity AngouriMath.MathS.LessOrEqualThan ( Entity  a,
Entity  b 
)
static

Parameters
aLeft argument node of which the less than or equal node will be taken
bRight argument node of which the less than or equal node function will be taken
Returns
A node

using System; using static AngouriMath.MathS;

var (x, y) = Var("x", "y");

Console.WriteLine(GreaterThan(x, y)); Console.WriteLine(GreaterThan(6, 5)); Console.WriteLine(GreaterThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessThan(x, y)); Console.WriteLine(LessThan(6, 5)); Console.WriteLine(LessThan(6, 5).EvalBoolean()); Console.WriteLine(LessThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(GreaterOrEqualThan(x, y)); Console.WriteLine(GreaterOrEqualThan(6, 5)); Console.WriteLine(GreaterOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessOrEqualThan(x, y)); Console.WriteLine(LessOrEqualThan(6, 5)); Console.WriteLine(LessOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(LessOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); var statement1 = GreaterThan(Sqr(x), 5); Console.WriteLine(statement1); Console.WriteLine(statement1.Solve("x")); Console.WriteLine("----------------------------------"); var statement2 = GreaterThan(Sqr(x), 16) & LessThan(x, y); Console.WriteLine(statement2); Console.WriteLine(statement2.Solve("x")); Console.WriteLine("----------------------------------"); var statement3 = LessThan(Sqr(x), 16) & GreaterThan(x, 2); Console.WriteLine(statement3); Console.WriteLine(statement3.Solve("x")); Prints x > y 6 > 5 True

False

x < y 6 < 5 False

False

x >= y 6 >= 5 True

True

x <= y 6 <= 5 False

True

x ^ 2 > 5

(-oo; -sqrt(20) / 2) \/ (sqrt(20) / 2; +oo)

x ^ 2 > 16 and x < y

((-oo; -4) \/ (4; +oo)) /\ (-oo; -y / (-1))

x ^ 2 < 16 and x > 2 (2; 4)

◆ LessThan()

static Entity AngouriMath.MathS.LessThan ( Entity  a,
Entity  b 
)
static

Parameters
aLeft argument node of which the less than node will be taken
bRight argument node of which the less than node function will be taken
Returns
A node

using System; using static AngouriMath.MathS;

var (x, y) = Var("x", "y");

Console.WriteLine(GreaterThan(x, y)); Console.WriteLine(GreaterThan(6, 5)); Console.WriteLine(GreaterThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessThan(x, y)); Console.WriteLine(LessThan(6, 5)); Console.WriteLine(LessThan(6, 5).EvalBoolean()); Console.WriteLine(LessThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(GreaterOrEqualThan(x, y)); Console.WriteLine(GreaterOrEqualThan(6, 5)); Console.WriteLine(GreaterOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessOrEqualThan(x, y)); Console.WriteLine(LessOrEqualThan(6, 5)); Console.WriteLine(LessOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(LessOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); var statement1 = GreaterThan(Sqr(x), 5); Console.WriteLine(statement1); Console.WriteLine(statement1.Solve("x")); Console.WriteLine("----------------------------------"); var statement2 = GreaterThan(Sqr(x), 16) & LessThan(x, y); Console.WriteLine(statement2); Console.WriteLine(statement2.Solve("x")); Console.WriteLine("----------------------------------"); var statement3 = LessThan(Sqr(x), 16) & GreaterThan(x, 2); Console.WriteLine(statement3); Console.WriteLine(statement3.Solve("x")); Prints x > y 6 > 5 True

False

x < y 6 < 5 False

False

x >= y 6 >= 5 True

True

x <= y 6 <= 5 False

True

x ^ 2 > 5

(-oo; -sqrt(20) / 2) \/ (sqrt(20) / 2; +oo)

x ^ 2 > 16 and x < y

((-oo; -4) \/ (4; +oo)) /\ (-oo; -y / (-1))

x ^ 2 < 16 and x > 2 (2; 4)

◆ Limit()

static Entity AngouriMath.MathS.Limit ( Entity  expr,
Entity  var,
Entity  dest,
ApproachFrom  approach = ApproachFrom.BothSides 
)
static

Hangs your entity to a limit node (to evaluate instead use Compute.Limit(Entity, Variable, Entity))

Parameters
exprExpression to be hung
varVariable over which limit is taken
destWhere var approaches (could be finite or infinite)
approachFrom where it approaches
using System;
using static AngouriMath.MathS;
var (x, a) = Var("x", "a");
var e1 = Derivative(Sin(Cos(x)), x);
Console.WriteLine(e1);
Console.WriteLine(e1.InnerSimplified);
Console.WriteLine("-----------------------");
var e2 = Derivative(Sin(Cos(x)), x, 2);
Console.WriteLine(e2);
Console.WriteLine(e2.InnerSimplified);
Console.WriteLine("-----------------------");
var e3 = Integral(Sin(a * x), x);
Console.WriteLine(e3);
Console.WriteLine(e3.InnerSimplified);
Console.WriteLine("-----------------------");
var e4 = Integral(Sin(a * x), x, 2);
Console.WriteLine(e4);
Console.WriteLine(e4.InnerSimplified);
Console.WriteLine("-----------------------");
var e5 = Limit(Sin(a * x) / x, x, 0);
Console.WriteLine(e5);
Console.WriteLine(e5.InnerSimplified);

Prints

derivative(sin(cos(x)), x)
<h2>cos(cos(x)) * -sin(x)
</h2>
derivative(sin(cos(x)), x, 2)
<h2>-sin(cos(x)) * -sin(x) * -sin(x) + cos(x) * (-1) * cos(cos(x))
</h2>
integral(sin(a * x), x)
<h2>-cos(a * x) / a
</h2>
integral(sin(a * x), x, 2)
<h2>-sin(a * x) / a / a
</h2>
limit(sin(a * x) / x, x, 0)
a

◆ Ln()

static Entity AngouriMath.MathS.Ln ( Entity  a)
static

Is a special case of logarithm where the base equals e:

Parameters
aArgument node of which natural logarithm will be taken
Returns
Logarithm node with base equal to e
using System;
using static AngouriMath.MathS;
Console.WriteLine(Log(2, 16));
Console.WriteLine(Log(2, 16).Evaled);
Console.WriteLine(Log(3, 81));
Console.WriteLine(Log(3, 81).Evaled);
Console.WriteLine(Log(10, 1000));
Console.WriteLine(Log(10, 1000).Evaled);
Console.WriteLine(Log(1000));
Console.WriteLine(Log(1000).Evaled);
Console.WriteLine(Ln(e.Pow(16)));
Console.WriteLine(Ln(e.Pow(16)).Evaled);

Prints

log(2, 16)
4
log(3, 81)
4
log(10, 1000)
3
log(10, 1000)
3
ln(e ^ 16)
16

◆ Log() [1/2]

static Entity AngouriMath.MathS.Log ( Entity base,
Entity  x 
)
static

Parameters
baseBase node of logarithm
xArgument node of logarithm
Returns
Logarithm node
using System;
using static AngouriMath.MathS;
Console.WriteLine(Log(2, 16));
Console.WriteLine(Log(2, 16).Evaled);
Console.WriteLine(Log(3, 81));
Console.WriteLine(Log(3, 81).Evaled);
Console.WriteLine(Log(10, 1000));
Console.WriteLine(Log(10, 1000).Evaled);
Console.WriteLine(Log(1000));
Console.WriteLine(Log(1000).Evaled);
Console.WriteLine(Ln(e.Pow(16)));
Console.WriteLine(Ln(e.Pow(16)).Evaled);

Prints

log(2, 16)
4
log(3, 81)
4
log(10, 1000)
3
log(10, 1000)
3
ln(e ^ 16)
16

◆ Log() [2/2]

static Entity AngouriMath.MathS.Log ( Entity  x)
static

◆ Matrix() [1/2]

static Matrix AngouriMath.MathS.Matrix ( Entity  values[,])
static

Creates an instance of Entity.Matrix.

Parameters
valuesA two-dimensional array of values. The first dimension is the row count, the second one is for columns.
Returns
A two-dimensional Entity.Matrix which is a matrix
using System;
using static AngouriMath.Entity;
using static AngouriMath.MathS;
var A = Matrix(new Entity[,]
{
{ 1, 2, 3 },
{ 4, 5, 6 }
}
);
Console.WriteLine(A.ToString(multilineFormat: true));
var B = Vector(1, 2, 3, 4);
Console.WriteLine(B.ToString(multilineFormat: true));
Matrix C = @"
[[1, 2],
[3, 4],
[5, 6]]
";
Console.WriteLine(C.ToString(multilineFormat: true));
Matrix D = "[1, 2, 3, 4]";
Console.WriteLine(D.ToString(multilineFormat: true));

Prints

Matrix[2 x 3]
1 2 3
4 5 6
Matrix[4 x 1]
1
2
3
4
Matrix[3 x 2]
1 2
3 4
5 6
Matrix[4 x 1]
1
2
3
4

◆ Matrix() [2/2]

static Matrix AngouriMath.MathS.Matrix ( int  rowCount,
int  colCount,
Func< int, int, Entity map 
)
static

Creates an instance of matrix, where each cell's index is mapped to a value with the help of the mapping function.

Parameters
rowCountThe number of rows (corresponds to the first index).
colCountThe number of columns (corresponds to the second index).
mapThe first argument of the mapping function function is the index of row, the second one for the column index.

Indexing starts from 0.

Returns
A newly created matrix of the given size.
using System;
using static AngouriMath.MathS;
var expr = "sin(x) + cos(y)";
var vars = new[] { Var("x"), Var("y") };
var A = Matrix(2, 2, (i1, i2) => expr
.Differentiate(vars[i1])
.Differentiate(vars[i2])
.Simplify());
Console.WriteLine(A.ToString(multilineFormat: true));
Console.WriteLine(ZeroMatrix(3));
Console.WriteLine(ZeroMatrix(3, 4));
Console.WriteLine(ZeroVector(3));

Prints

Matrix[2 x 2]
-sin(x) 0
0 -cos(y)
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
[0, 0, 0]

◆ MatrixFromIEnum2x2()

static Matrix AngouriMath.MathS.MatrixFromIEnum2x2 ( IEnumerable< IEnumerable< Entity >>  elements)
inlinestatic

Creates a matrix from given elements

Parameters
elementsThere should be at least one row. All rows must have the same number of columns
using System;
using static AngouriMath.MathS;
Console.WriteLine(Scalar(56));
Console.WriteLine(MatrixFromIEnum2x2(new Entity[][]
{
new Entity[]{ 1, 2, 3 },
new Entity[]{ 4, 5, 6 }
}
));

Prints

[56]
[[1, 2, 3], [4, 5, 6]]

◆ MatrixFromRows()

static Matrix AngouriMath.MathS.MatrixFromRows ( IEnumerable< Matrix vectors)
inlinestatic

Creates a matrix from given rows

Parameters
vectorsThere should be at least one row. All rows must have the same number of columns

◆ Negation()

static Entity AngouriMath.MathS.Negation ( Entity  a)
static

Boolean negation Wikipedia

Parameters
aArgument node of which Negation function will be taken
Returns
The Not node
using System;
using static AngouriMath.MathS;
Console.WriteLine(Negation("x"));
Console.WriteLine(Negation(Negation("x")));
Console.WriteLine(Negation(Negation("x")).Simplify());

Prints

not x
not not x
x

◆ Parse()

static ParsingResult AngouriMath.MathS.Parse ( string  source)
static

Parses an expression silently, that is, without throwing an exception.

Instead, it returns a Failure in case of encountered errors during parsing.

Returns
Returns a type union of the successful result and failure, which is a type union of multiple reasons it may have failed.

Multiple ways to parse an expression.

Entity expr1 = "a + b";
var expr2 = FromString("a + b");
var expr3 = FromString("a + b", useCache: false);
var expr4 = (Entity)"a + b";
var expr5 = Parse("a + b").Switch(
res => res,
failure => failure.Reason.Switch<object>(
unknown => throw new("Unknown reason"),
missingOp => throw new("Missing operator"),
internalError => throw new("Internal error")
)
);

◆ Piecewise() [1/2]

static Entity AngouriMath.MathS.Piecewise ( IEnumerable< Providedf >  cases,
Entity otherwise = null 
)
static

This is a piecewisely defined function, which turns into a particular definition once there exists a case number N such that case[N].Predicate is turned into true and for all i less than N : case[i].Predicate is turned into false.

For example, Piecewise(new Providedf(a, b), new Providedf(d, false), new Providedf(f, true)) will remain unchanged, because the first case is uncertain.

Piecewise(new Providedf(a, false), new Providedf(d, false), new Providedf(f, true)) will turn into f

Piecewise(new Providedf(a, false), new Providedf(d, false), new Providedf(f, false)) will turn into NaN

Parameters
casesCases, each of type Provided.
otherwiseAn otherwise case. Will be intepreted as otherwise.Provided(true). Optional.
using System;
using static AngouriMath.MathS;
var expr = Piecewise(
("-1", "x < 0"),
("0", "x = 0"),
("1", true)
);
Console.WriteLine(expr);
Console.WriteLine(expr.Substitute("x", 10).Evaled);
Console.WriteLine(expr.Substitute("x", 0).Evaled);
Console.WriteLine(expr.Substitute("x", -14).Evaled);
Console.WriteLine();
var weirdSqrt = Piecewise(
("sqrt(x)", "x >= 0"),
("-sqrt(-x)", true)
);
Console.WriteLine(weirdSqrt);
Console.WriteLine(weirdSqrt.Substitute("x", 16).Evaled);
Console.WriteLine(weirdSqrt.Substitute("x", -16).Evaled);
Console.WriteLine();
var thousandVisualizer = Piecewise(
("a / 1000000 million", "a > 1000000"),
("a / 1000 thousand", "a > 1000"),
("a", "a >= 0")
);
Console.WriteLine(thousandVisualizer.Substitute("a", 19301).Evaled);
Console.WriteLine(thousandVisualizer.Substitute("a", 19301123).Evaled);
Console.WriteLine(thousandVisualizer.Substitute("a", 32).Evaled);
Console.WriteLine(thousandVisualizer.Substitute("a", -24).Evaled);

Prints

(-1 if x < 0, 0 if x = 0, 1 if True)
1
0
-1
(sqrt(x) if x >= 0, -sqrt(-x) if True)
4
-4
19301/1000 * thousand
19301123/1000000 * million
32

◆ Piecewise() [2/2]

static Entity AngouriMath.MathS.Piecewise ( params(Entity expression, Entity predicate) []  cases)
static

This is a piecewisely defined function, which turns into a particular definition once there exists a case number N such that case[N].Predicate is turned into true and for all i less than N : case[i].Predicate is turned into false.

For example, Piecewise((a, b), (d, false), (f, true)) will remain unchanged, because the first case is uncertain.

Piecewise((a, false), (d, false), (f, true)) will turn into f

Piecewise((a, false), (d, false), (f, false)) will turn into NaN

Parameters
casesTuples of two expressions: an expression and a predicate
using System;
using static AngouriMath.MathS;
var expr = Piecewise(
("-1", "x < 0"),
("0", "x = 0"),
("1", true)
);
Console.WriteLine(expr);
Console.WriteLine(expr.Substitute("x", 10).Evaled);
Console.WriteLine(expr.Substitute("x", 0).Evaled);
Console.WriteLine(expr.Substitute("x", -14).Evaled);
Console.WriteLine();
var weirdSqrt = Piecewise(
("sqrt(x)", "x >= 0"),
("-sqrt(-x)", true)
);
Console.WriteLine(weirdSqrt);
Console.WriteLine(weirdSqrt.Substitute("x", 16).Evaled);
Console.WriteLine(weirdSqrt.Substitute("x", -16).Evaled);
Console.WriteLine();
var thousandVisualizer = Piecewise(
("a / 1000000 million", "a > 1000000"),
("a / 1000 thousand", "a > 1000"),
("a", "a >= 0")
);
Console.WriteLine(thousandVisualizer.Substitute("a", 19301).Evaled);
Console.WriteLine(thousandVisualizer.Substitute("a", 19301123).Evaled);
Console.WriteLine(thousandVisualizer.Substitute("a", 32).Evaled);
Console.WriteLine(thousandVisualizer.Substitute("a", -24).Evaled);

Prints

(-1 if x < 0, 0 if x = 0, 1 if True)
1
0
-1
(sqrt(x) if x >= 0, -sqrt(-x) if True)
4
-4
19301/1000 * thousand
19301123/1000000 * million
32

◆ Pow()

static Entity AngouriMath.MathS.Pow ( Entity base,
Entity  power 
)
static

Parameters
baseBase node of power
powerArgument node of power
Returns
Power node
using System;
using static AngouriMath.MathS;
Console.WriteLine(Pow(2, 5));
Console.WriteLine(Pow(2, 5).Simplify());
Console.WriteLine(Pow(e, 2));
Console.WriteLine(Pow(e, 2).Simplify());
Console.WriteLine(Pow(e, 2).Evaled);
Console.WriteLine(Sqrt(Sqr("x")));
Console.WriteLine(Sqrt(Sqr("x")).Simplify());
Console.WriteLine(Pow(Cbrt("a"), 3));
Console.WriteLine(Pow(Cbrt("a"), 3).Simplify());
Console.WriteLine(Pow(Cbrt("a"), 6));
Console.WriteLine(Pow(Cbrt("a"), 6).Simplify());

Prints

2 ^ 5
32
e ^ 2
e ^ 2
7.389056098930650227230427460575007813180315570551847324087127822522573796079057763384312485079121792
sqrt(x ^ 2)
x
a ^ (1/3) ^ 3
a
a ^ (1/3) ^ 6
a ^ 2

◆ Provided()

static Entity AngouriMath.MathS.Provided ( Entity  expression,
Entity  condition 
)
static

This will be turned into expression if the condition is true, into NaN if condition is false, and remain the same otherwise

Parameters
expressionThe expression is extracted if the predicate is true
conditionCondition when the expression is defined
Returns
The Provided node
using System;
using static AngouriMath.MathS;
Console.WriteLine(Provided("a = b", "pi = 4"));
Console.WriteLine(Provided("a = b", "pi = 4").Simplify());
Console.WriteLine();
var expr = Provided("1000", "a = b")
.Substitute("a", 5)
.Substitute("b", 130)
;
Console.WriteLine(expr);
Console.WriteLine(expr.Evaled);
Console.WriteLine();
var expr1 = Provided("1000", "a = b")
.Substitute("a", 5)
.Substitute("b", 5)
;
Console.WriteLine(expr1);
Console.WriteLine(expr1.Evaled);

Prints

a = b provided pi = 4
1000 provided 5 = 130
1000 provided 5 = 5
1000

◆ Scalar()

static Matrix AngouriMath.MathS.Scalar ( Entity  value)
static

Creates a 1x1 matrix of a given value.

It will be simplified once InnerSimplified or Evaled are addressed

Returns
A 1x1 matrix, which is also a 1-long vector, or just a scalar.
using System;
using static AngouriMath.MathS;
Console.WriteLine(Scalar(56));
Console.WriteLine(MatrixFromIEnum2x2(new Entity[][]
{
new Entity[]{ 1, 2, 3 },
new Entity[]{ 4, 5, 6 }
}
));

Prints

[56]
[[1, 2, 3], [4, 5, 6]]

◆ Sec()

static Entity AngouriMath.MathS.Sec ( Entity  a)
static

Parameters
aArgument node of secant
Returns
Secant node
using System;
using static AngouriMath.MathS;
var expr = Sec("x") / Cosec("x");
Console.WriteLine(expr);
Console.WriteLine(expr.Simplify());

Prints

sec(x) / csc(x)
tan(x)

◆ SetSubtraction()

static Set AngouriMath.MathS.SetSubtraction ( Entity  a,
Entity  b 
)
static

Parameters
aLeft argument node of which the set subtraction node will be taken That is, the resulting set of set subtraction is necessarily superset of this set
bRight argument node of which the set subtraction set node will be taken That is, there is no element in the resulting set that belong to this one
Returns
A node

using AngouriMath; using System; using static AngouriMath.Entity.Set; using static AngouriMath.MathS; using static AngouriMath.MathS.Sets;

var set1 = Finite(1, 2, 3); var set2 = Finite(2, 3, 4); var set3 = MathS.Interval(-6, 2); var set4 = new ConditionalSet("x", "100 &gt; x2 &gt; 81"); Console.WriteLine(Union(set1, set2)); Console.WriteLine(Union(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set3)); Console.WriteLine(Union(set1, set3).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set4)); Console.WriteLine(ElementInSet(3, Union(set1, set4))); Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(4, Union(set1, set4))); Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(9.5, Union(set1, set4))); Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set1, set2)); Console.WriteLine(Intersection(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set2, set3)); Console.WriteLine(Intersection(set2, set3).Simplify()); Console.WriteLine("----------------------"); var set5 = MathS.Interval(-3, 11); Console.WriteLine(Intersection(set3, set5)); Console.WriteLine(Intersection(set3, set5).Simplify()); Console.WriteLine(Union(set3, set5)); Console.WriteLine(Union(set3, set5).Simplify()); Console.WriteLine(SetSubtraction(set3, set5)); Console.WriteLine(SetSubtraction(set3, set5).Simplify()); Console.WriteLine("----------------------"); Entity syntax1 = "{ 1, 2, 3 } /\ { 2, 3, 4 }"; Console.WriteLine(syntax1); Console.WriteLine(syntax1.Simplify()); Console.WriteLine("----------------------"); Entity syntax2 = "5 in ([1; +oo) \/ { x : x < -4 })"; Console.WriteLine(syntax2); Console.WriteLine(syntax2.Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify()); Prints { 1, 2, 3 } \/ { 2, 3, 4 }

{ 1, 2, 3, 4 }

{ 1, 2, 3 } \/ [-6; 2]

{ 3 } \/ [-6; 2]

{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } 3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True 4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } False 19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }

True

{ 1, 2, 3 } /\ { 2, 3, 4 }

{ 2, 3 }

{ 2, 3, 4 } /\ [-6; 2]

{ 2 }

[-6; 2] /\ [-3; 11] [-3; 2] [-6; 2] \/ [-3; 11] [-6; 11] [-6; 2] \ [-3; 11]

[-6; -3)

{ 1, 2, 3 } /\ { 2, 3, 4 }

{ 2, 3 }

5 in [1; +oo) \/ { x : x < -4 }

True

{ pi, e, 6, 11/2, 1 + 3i } /\ QQ { 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ RR { pi, e, 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ CC { pi, e, 6, 11/2, 1 + 3i }

◆ Signum()

static Entity AngouriMath.MathS.Signum ( Entity  a)
static

https://en.wikipedia.org/wiki/Sign_function

Parameters
aArgument node of which Signum function will be taken
Returns
Signum node
using System;
using static AngouriMath.MathS;
Console.WriteLine(Signum(-5));
Console.WriteLine(Signum(-5).Evaled);
Console.WriteLine(Signum(0));
Console.WriteLine(Signum(0).Evaled);
Console.WriteLine(Signum(5));
Console.WriteLine(Signum(5).Evaled);
Console.WriteLine(Signum(4 + 3 * i));
Console.WriteLine(Signum(4 + 3 * i).Evaled);

Prints

sgn(-5)
-1
sgn(0)
0
sgn(5)
1
sgn(4 + 3i)
4/5 + (3/5)i

◆ Sin()

static Entity AngouriMath.MathS.Sin ( Entity  a)
static

Parameters
aArgument node of sine
Returns
Sine node
using System;
using static AngouriMath.MathS;
var expr = Sin("x").Pow(2) + Cos("x").Pow(2);
Console.WriteLine(expr);
Console.WriteLine(expr.Simplify());

Prints

sin(x) ^ 2 + cos(x) ^ 2
1

◆ SolveBooleanTable()

static Matrix AngouriMath.MathS.SolveBooleanTable ( Entity  expression,
params Variable []  variables 
)
static

Solves a boolean expression.

That is, finds all values for variables such that the expression turns into True when evaluated Uses a simple table of truth Use Entity.SolveBoolean(Variable) for smart solving

Entity expr = "(a xor b or c) implies (a or c)";
var sols = MathS.SolveBooleanTable(expr, "a", "b", "c");
if (sols is null)
Console.WriteLine("No solution found");
else
{
Console.WriteLine(sols.ToString(multilineFormat: true));
Console.WriteLine();
for (int i = 0; i < sols.RowCount; i++)
{
var a = (bool)sols[i, 0].EvalBoolean();
var b = (bool)sols[i, 1].EvalBoolean();
var c = (bool)sols[i, 2].EvalBoolean();
Console.WriteLine($"Solution #{i}: {a}, {b}, {c}");
}
}

◆ SolveEquation()

static Set AngouriMath.MathS.SolveEquation ( Entity  equation,
Variable  var 
)
static

Solves one equation over one variable

Parameters
equationAn equation that is assumed to equal 0
varVariable whose values we are looking for
Returns
A Set of possible values or intervals of values
Entity eq1 = "x^2 - 1";
Console.WriteLine(MathS.SolveEquation(eq1, "x"));
Entity eq2 = "sin(a u) - cos(a u)";
Console.WriteLine(MathS.SolveEquation(eq2, "u"));

Prints { 1, -1 } { ln(-sqrt(-2) / (-1 - i)) / i / a, ln(sqrt(-2) / (-1 - i)) / i / a }

◆ Sqr()

static Entity AngouriMath.MathS.Sqr ( Entity  a)
static

Special case of

Parameters
aArgument to be squared
Returns
Power node with 2 as the power
using System;
using static AngouriMath.MathS;
Console.WriteLine(Pow(2, 5));
Console.WriteLine(Pow(2, 5).Simplify());
Console.WriteLine(Pow(e, 2));
Console.WriteLine(Pow(e, 2).Simplify());
Console.WriteLine(Pow(e, 2).Evaled);
Console.WriteLine(Sqrt(Sqr("x")));
Console.WriteLine(Sqrt(Sqr("x")).Simplify());
Console.WriteLine(Pow(Cbrt("a"), 3));
Console.WriteLine(Pow(Cbrt("a"), 3).Simplify());
Console.WriteLine(Pow(Cbrt("a"), 6));
Console.WriteLine(Pow(Cbrt("a"), 6).Simplify());

Prints

2 ^ 5
32
e ^ 2
e ^ 2
7.389056098930650227230427460575007813180315570551847324087127822522573796079057763384312485079121792
sqrt(x ^ 2)
x
a ^ (1/3) ^ 3
a
a ^ (1/3) ^ 6
a ^ 2

◆ Sqrt()

static Entity AngouriMath.MathS.Sqrt ( Entity  a)
static

Special case of

Parameters
aThe argument of which square root will be taken
Returns
Power node with (1/2) as the power
using System;
using static AngouriMath.MathS;
Console.WriteLine(Pow(2, 5));
Console.WriteLine(Pow(2, 5).Simplify());
Console.WriteLine(Pow(e, 2));
Console.WriteLine(Pow(e, 2).Simplify());
Console.WriteLine(Pow(e, 2).Evaled);
Console.WriteLine(Sqrt(Sqr("x")));
Console.WriteLine(Sqrt(Sqr("x")).Simplify());
Console.WriteLine(Pow(Cbrt("a"), 3));
Console.WriteLine(Pow(Cbrt("a"), 3).Simplify());
Console.WriteLine(Pow(Cbrt("a"), 6));
Console.WriteLine(Pow(Cbrt("a"), 6).Simplify());

Prints

2 ^ 5
32
e ^ 2
e ^ 2
7.389056098930650227230427460575007813180315570551847324087127822522573796079057763384312485079121792
sqrt(x ^ 2)
x
a ^ (1/3) ^ 3
a
a ^ (1/3) ^ 6
a ^ 2

◆ Tan()

static Entity AngouriMath.MathS.Tan ( Entity  a)
static

Parameters
aArgument node of which tangent will be taken
Returns
Tangent node
using System;
using static AngouriMath.MathS;
var expr = Tan("x") * Cotan("x");
Console.WriteLine(expr);
Console.WriteLine(expr.Simplify());
var expr2 = Tan("x") * Cos("x");
Console.WriteLine(expr2.Simplify());

Prints

tan(x) * cotan(x)
1
sin(x)

◆ ToBaseN()

static string AngouriMath.MathS.ToBaseN ( Real  num,
int  N 
)
static

Translates a Number in base 10 into base N

Parameters
numA Real in base 10 to be translated into base N
NThe base to translate the number into
Returns
A string with the number in the required base
using System;
using static AngouriMath.MathS;
using var _ = Settings.DowncastingEnabled.Set(false);
Console.WriteLine(ToBaseN(1.5m, 2));
Console.WriteLine(ToBaseN(3.75m, 2));
Console.WriteLine(ToBaseN(13.125m, 2));
Console.WriteLine(ToBaseN(13.125m, 10));
// uncomment when https://github.com/asc-community/AngouriMath/issues/584
// is fixed
// Console.WriteLine(ToBaseN(13.125m, 5));
Console.WriteLine(ToBaseN(13.125m, 8));
Console.WriteLine("-----------------------");
Console.WriteLine(FromBaseN("FF", 16));
Console.WriteLine(FromBaseN("77", 8));
Console.WriteLine(FromBaseN("1.1", 2));
Console.WriteLine(FromBaseN("1.01", 2));
Console.WriteLine(FromBaseN("1.05", 6));

Prints

1.1
11.11
1101.001
13.125
<h2>15.1
</h2>
255
63
1.500000000
1.250000000
1.138888888

◆ ToSympyCode()

static string AngouriMath.MathS.ToSympyCode ( Entity  expr)
inlinestatic

Returns
sympy interpretable format
Parameters
exprAn Entity representing an expression

using System; using static AngouriMath.MathS;

var (x, y, a) = Var("x", "y", "a"); var expr = Limit(Integral(Sin(x) / (Cos(x) + Tan(y)), x) / a, y, +oo); Console.WriteLine(expr); Console.WriteLine("----------------------------"); Console.WriteLine(ToSympyCode(expr)); Prints

limit(integral(sin(x) / (cos(x) + tan(y)), x) / a, y, +oo)

import sympy

x = sympy.Symbol('x') y = sympy.Symbol('y') a = sympy.Symbol('a')

expr = sympy.limit(sympy.integrate(sympy.sin(x) / (sympy.cos(x) + sympy.tan(y)), x, 1) / a, y, +oo)

◆ TryPolynomial()

static bool AngouriMath.MathS.TryPolynomial ( Entity  expr,
Variable  variable,
[NotNullWhen(true)] out Entity dst 
)
static

Returns an Entity in polynomial order if possible

Parameters
exprThe unordered Entity
variableThe variable of the polynomial
dstThe ordered result
Returns
if success, otherwise (dst will be )
using System;
using static AngouriMath.MathS;
Entity expr = "a x + b (x + 3) + (x + 2) * (x + 3)";
if (TryPolynomial(expr, "x", out var res))
Console.WriteLine(res);
else
Console.WriteLine("Cannot get polynomial :((");
Entity expr2 = "sin(x) + cos(x)";
if (TryPolynomial(expr2, "x", out var res2))
Console.WriteLine(res2);
else
Console.WriteLine("Cannot get polynomial :((");

Prints

x ^ 2 + (a + b + 3 + 2) * x + b * 3 + 6
Cannot get polynomial :((

◆ Union()

static Set AngouriMath.MathS.Union ( Entity  a,
Entity  b 
)
static

Parameters
aLeft argument node of which the union set node will be taken
bRight argument node of which the union set node will be taken
Returns
A node

using AngouriMath; using System; using static AngouriMath.Entity.Set; using static AngouriMath.MathS; using static AngouriMath.MathS.Sets;

var set1 = Finite(1, 2, 3); var set2 = Finite(2, 3, 4); var set3 = MathS.Interval(-6, 2); var set4 = new ConditionalSet("x", "100 &gt; x2 &gt; 81"); Console.WriteLine(Union(set1, set2)); Console.WriteLine(Union(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set3)); Console.WriteLine(Union(set1, set3).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set4)); Console.WriteLine(ElementInSet(3, Union(set1, set4))); Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(4, Union(set1, set4))); Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(9.5, Union(set1, set4))); Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set1, set2)); Console.WriteLine(Intersection(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set2, set3)); Console.WriteLine(Intersection(set2, set3).Simplify()); Console.WriteLine("----------------------"); var set5 = MathS.Interval(-3, 11); Console.WriteLine(Intersection(set3, set5)); Console.WriteLine(Intersection(set3, set5).Simplify()); Console.WriteLine(Union(set3, set5)); Console.WriteLine(Union(set3, set5).Simplify()); Console.WriteLine(SetSubtraction(set3, set5)); Console.WriteLine(SetSubtraction(set3, set5).Simplify()); Console.WriteLine("----------------------"); Entity syntax1 = "{ 1, 2, 3 } /\ { 2, 3, 4 }"; Console.WriteLine(syntax1); Console.WriteLine(syntax1.Simplify()); Console.WriteLine("----------------------"); Entity syntax2 = "5 in ([1; +oo) \/ { x : x < -4 })"; Console.WriteLine(syntax2); Console.WriteLine(syntax2.Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify()); Prints { 1, 2, 3 } \/ { 2, 3, 4 }

{ 1, 2, 3, 4 }

{ 1, 2, 3 } \/ [-6; 2]

{ 3 } \/ [-6; 2]

{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } 3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True 4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } False 19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }

True

{ 1, 2, 3 } /\ { 2, 3, 4 }

{ 2, 3 }

{ 2, 3, 4 } /\ [-6; 2]

{ 2 }

[-6; 2] /\ [-3; 11] [-3; 2] [-6; 2] \/ [-3; 11] [-6; 11] [-6; 2] \ [-3; 11]

[-6; -3)

{ 1, 2, 3 } /\ { 2, 3, 4 }

{ 2, 3 }

5 in [1; +oo) \/ { x : x < -4 }

True

{ pi, e, 6, 11/2, 1 + 3i } /\ QQ { 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ RR { pi, e, 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ CC { pi, e, 6, 11/2, 1 + 3i }

◆ Var()

static Variable AngouriMath.MathS.Var ( string  name)
static

Creates an instance of Variable.

Parameters
nameThe name of the Variable which equality is based on.
Returns
Variable node

Here are multiple ways to create variables:

Entity.Variable x = "x";
var y = Var("y");
var (a, b) = Var("x", "y");
var (c, d, e) = Var("a", "b", "c");
var f = Var("f_1");
var alpha = Var("alpha");
var alphaPhi = Var("alpha_phi");
var alpha1 = Var("alpha_1");
var inGreek = Var("βγδεζη_кΨеВеТкΩ");
var inCyrillic = Var("Абаваола");

Underscore "_" allows indexing. Greek letter names (e. g. "alpha") will be latexised as Greek letter (but other than that, will appear as "alpha" in other places).

◆ Vector()

static Matrix AngouriMath.MathS.Vector ( params Entity []  values)
static

Creates an instance of Entity.Matrix that has one column.

Parameters
valuesThe cells of the Entity.Matrix
Returns
A one-dimensional Entity.Matrix which is a vector
using System;
using static AngouriMath.Entity;
using static AngouriMath.MathS;
var A = Matrix(new Entity[,]
{
{ 1, 2, 3 },
{ 4, 5, 6 }
}
);
Console.WriteLine(A.ToString(multilineFormat: true));
var B = Vector(1, 2, 3, 4);
Console.WriteLine(B.ToString(multilineFormat: true));
Matrix C = @"
[[1, 2],
[3, 4],
[5, 6]]
";
Console.WriteLine(C.ToString(multilineFormat: true));
Matrix D = "[1, 2, 3, 4]";
Console.WriteLine(D.ToString(multilineFormat: true));

Prints

Matrix[2 x 3]
1 2 3
4 5 6
Matrix[4 x 1]
1
2
3
4
Matrix[3 x 2]
1 2
3 4
5 6
Matrix[4 x 1]
1
2
3
4

◆ ZeroMatrix() [1/2]

static Matrix AngouriMath.MathS.ZeroMatrix ( int  size)
static

Creates a zero square matrix

using System;
using static AngouriMath.MathS;
var expr = "sin(x) + cos(y)";
var vars = new[] { Var("x"), Var("y") };
var A = Matrix(2, 2, (i1, i2) => expr
.Differentiate(vars[i1])
.Differentiate(vars[i2])
.Simplify());
Console.WriteLine(A.ToString(multilineFormat: true));
Console.WriteLine(ZeroMatrix(3));
Console.WriteLine(ZeroMatrix(3, 4));
Console.WriteLine(ZeroVector(3));

Prints

Matrix[2 x 2]
-sin(x) 0
0 -cos(y)
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
[0, 0, 0]

◆ ZeroMatrix() [2/2]

static Matrix AngouriMath.MathS.ZeroMatrix ( int  rowCount,
int  columnCount 
)
static

Creates a zero square matrix

using System;
using static AngouriMath.MathS;
var expr = "sin(x) + cos(y)";
var vars = new[] { Var("x"), Var("y") };
var A = Matrix(2, 2, (i1, i2) => expr
.Differentiate(vars[i1])
.Differentiate(vars[i2])
.Simplify());
Console.WriteLine(A.ToString(multilineFormat: true));
Console.WriteLine(ZeroMatrix(3));
Console.WriteLine(ZeroMatrix(3, 4));
Console.WriteLine(ZeroVector(3));

Prints

Matrix[2 x 2]
-sin(x) 0
0 -cos(y)
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
[0, 0, 0]

◆ ZeroVector()

static Matrix AngouriMath.MathS.ZeroVector ( int  size)
static

Creates a zero vector

using System;
using static AngouriMath.MathS;
var expr = "sin(x) + cos(y)";
var vars = new[] { Var("x"), Var("y") };
var A = Matrix(2, 2, (i1, i2) => expr
.Differentiate(vars[i1])
.Differentiate(vars[i2])
.Simplify());
Console.WriteLine(A.ToString(multilineFormat: true));
Console.WriteLine(ZeroMatrix(3));
Console.WriteLine(ZeroMatrix(3, 4));
Console.WriteLine(ZeroVector(3));

Prints

Matrix[2 x 2]
-sin(x) 0
0 -cos(y)
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
[0, 0, 0]

Member Data Documentation

◆ e

readonly Variable AngouriMath.MathS.e = Variable.e
static

The e constant

There are multiple constants available. Examples:

var x = Var("x");
Console.WriteLine(e);
Console.WriteLine(e.Evaled);
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo));
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo).Simplify());
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo).Simplify() == e);
Console.WriteLine("-----------------------");
Console.WriteLine(pi);
Console.WriteLine(pi.Evaled);
Console.WriteLine(Sin(pi / 3).Simplify());
Console.WriteLine(Cos(pi / 3).Simplify());
Console.WriteLine("-----------------------");
Console.WriteLine(i);
Console.WriteLine(4 + 3 * i);
Console.WriteLine("-----------------------");
Console.WriteLine(e.Pow(i * pi));
Console.WriteLine(e.Pow(i * pi).Simplify());

Prints

2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427
limit((1 + 1 / x) ^ x, x, +oo)
<h2>True
</h2>
pi
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068
sqrt(3) / 2
<h2>1/2
</h2>
i
<h2>4 + 3i
</h2>
e ^ (i * pi)
-1

◆ i

readonly Complex AngouriMath.MathS.i = Complex.ImaginaryOne
static

The imaginary one

There are multiple constants available. Examples:

var x = Var("x");
Console.WriteLine(e);
Console.WriteLine(e.Evaled);
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo));
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo).Simplify());
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo).Simplify() == e);
Console.WriteLine("-----------------------");
Console.WriteLine(pi);
Console.WriteLine(pi.Evaled);
Console.WriteLine(Sin(pi / 3).Simplify());
Console.WriteLine(Cos(pi / 3).Simplify());
Console.WriteLine("-----------------------");
Console.WriteLine(i);
Console.WriteLine(4 + 3 * i);
Console.WriteLine("-----------------------");
Console.WriteLine(e.Pow(i * pi));
Console.WriteLine(e.Pow(i * pi).Simplify());

Prints

2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427
limit((1 + 1 / x) ^ x, x, +oo)
<h2>True
</h2>
pi
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068
sqrt(3) / 2
<h2>1/2
</h2>
i
<h2>4 + 3i
</h2>
e ^ (i * pi)
-1

◆ I_1

readonly Matrix AngouriMath.MathS.I_1 = IdentityMatrix(1)
static

The square identity matrix of size 1

using System;
using static AngouriMath.MathS;
Console.WriteLine(I_1.ToString(multilineFormat: true));
Console.WriteLine(I_2.ToString(multilineFormat: true));
Console.WriteLine(I_3.ToString(multilineFormat: true));
Console.WriteLine(I_4.ToString(multilineFormat: true));

Prints

Matrix[1 x 1]
1
Matrix[2 x 2]
1 0
0 1
Matrix[3 x 3]
1 0 0
0 1 0
0 0 1
Matrix[4 x 4]
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

◆ I_2

readonly Matrix AngouriMath.MathS.I_2 = IdentityMatrix(2)
static

The square identity matrix of size 2

using System;
using static AngouriMath.MathS;
Console.WriteLine(I_1.ToString(multilineFormat: true));
Console.WriteLine(I_2.ToString(multilineFormat: true));
Console.WriteLine(I_3.ToString(multilineFormat: true));
Console.WriteLine(I_4.ToString(multilineFormat: true));

Prints

Matrix[1 x 1]
1
Matrix[2 x 2]
1 0
0 1
Matrix[3 x 3]
1 0 0
0 1 0
0 0 1
Matrix[4 x 4]
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

◆ I_3

readonly Matrix AngouriMath.MathS.I_3 = IdentityMatrix(3)
static

The square identity matrix of size 3

using System;
using static AngouriMath.MathS;
Console.WriteLine(I_1.ToString(multilineFormat: true));
Console.WriteLine(I_2.ToString(multilineFormat: true));
Console.WriteLine(I_3.ToString(multilineFormat: true));
Console.WriteLine(I_4.ToString(multilineFormat: true));

Prints

Matrix[1 x 1]
1
Matrix[2 x 2]
1 0
0 1
Matrix[3 x 3]
1 0 0
0 1 0
0 0 1
Matrix[4 x 4]
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

◆ I_4

readonly Matrix AngouriMath.MathS.I_4 = IdentityMatrix(4)
static

The square identity matrix of size 4

using System;
using static AngouriMath.MathS;
Console.WriteLine(I_1.ToString(multilineFormat: true));
Console.WriteLine(I_2.ToString(multilineFormat: true));
Console.WriteLine(I_3.ToString(multilineFormat: true));
Console.WriteLine(I_4.ToString(multilineFormat: true));

Prints

Matrix[1 x 1]
1
Matrix[2 x 2]
1 0
0 1
Matrix[3 x 3]
1 0 0
0 1 0
0 0 1
Matrix[4 x 4]
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

◆ NaN

readonly Entity AngouriMath.MathS.NaN = Real.NaN
static

NaN represents both "undefined" and "indeterminate".

Any operation on NaN returns NaN

Let's consider MathS.oo and MathS.NaN.

using System;
using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
var expr1 = Sin(x) / y;
Console.WriteLine(expr1);
Console.WriteLine(expr1.Substitute(y, 0));
Console.WriteLine(expr1.Substitute(y, 0).Evaled);
Console.WriteLine(expr1.Substitute(y, 0).Evaled == NaN);
Console.WriteLine("--------------------------------");
var expr2 = 5 + NaN;
Console.WriteLine(expr2);
Console.WriteLine(expr2.Evaled);
Console.WriteLine("--------------------------------");
var expr3 = Sin(NaN) / Cos(x) + y;
Console.WriteLine(expr3);
Console.WriteLine(expr3.Evaled);
Console.WriteLine("--------------------------------");
var expr4 = 10 * +oo;
Console.WriteLine(expr4);
Console.WriteLine("--------------------------------");
var expr5 = -oo * +oo;
Console.WriteLine(expr5);
Console.WriteLine("--------------------------------");
var expr6 = -oo / +oo;
Console.WriteLine(expr6);
Console.WriteLine("--------------------------------");
var expr7 = 50 / -oo;
Console.WriteLine(expr7);

Prints

sin(x) / y
sin(x) / 0
<h2>True
</h2>
5 + NaN
<h2>NaN
</h2>
sin(NaN) / cos(x) + y
<h2>NaN
</h2>
<h2>+oo
</h2>
<h2>-oo
</h2>
<h2>NaN
</h2>
0

See Entity.IsFinite for determining if there are NaNs or infinities inside an expression.

◆ O_1

readonly Matrix AngouriMath.MathS.O_1 = ZeroMatrix(1)
static

The square zero matrix of size 1

Console.WriteLine(O_1.ToString(multilineFormat: true));
Console.WriteLine(O_2.ToString(multilineFormat: true));
Console.WriteLine(O_3.ToString(multilineFormat: true));
Console.WriteLine(O_4.ToString(multilineFormat: true));

Prints

Matrix[1 x 1]
0
Matrix[2 x 2]
0 0
0 0
Matrix[3 x 3]
0 0 0
0 0 0
0 0 0
Matrix[4 x 4]
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

◆ O_2

readonly Matrix AngouriMath.MathS.O_2 = ZeroMatrix(2)
static

The square zero matrix of size 2

Console.WriteLine(O_1.ToString(multilineFormat: true));
Console.WriteLine(O_2.ToString(multilineFormat: true));
Console.WriteLine(O_3.ToString(multilineFormat: true));
Console.WriteLine(O_4.ToString(multilineFormat: true));

Prints

Matrix[1 x 1]
0
Matrix[2 x 2]
0 0
0 0
Matrix[3 x 3]
0 0 0
0 0 0
0 0 0
Matrix[4 x 4]
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

◆ O_3

readonly Matrix AngouriMath.MathS.O_3 = ZeroMatrix(3)
static

The square zero matrix of size 3

Console.WriteLine(O_1.ToString(multilineFormat: true));
Console.WriteLine(O_2.ToString(multilineFormat: true));
Console.WriteLine(O_3.ToString(multilineFormat: true));
Console.WriteLine(O_4.ToString(multilineFormat: true));

Prints

Matrix[1 x 1]
0
Matrix[2 x 2]
0 0
0 0
Matrix[3 x 3]
0 0 0
0 0 0
0 0 0
Matrix[4 x 4]
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

◆ O_4

readonly Matrix AngouriMath.MathS.O_4 = ZeroMatrix(4)
static

The square zero matrix of size 4

Console.WriteLine(O_1.ToString(multilineFormat: true));
Console.WriteLine(O_2.ToString(multilineFormat: true));
Console.WriteLine(O_3.ToString(multilineFormat: true));
Console.WriteLine(O_4.ToString(multilineFormat: true));

Prints

Matrix[1 x 1]
0
Matrix[2 x 2]
0 0
0 0
Matrix[3 x 3]
0 0 0
0 0 0
0 0 0
Matrix[4 x 4]
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

◆ oo

readonly Real AngouriMath.MathS.oo = (Real)(Entity)"+oo"
static

Infinity.

Recommended to use with a plus or minus trailing.

Let's consider MathS.oo and MathS.NaN.

using System;
using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
var expr1 = Sin(x) / y;
Console.WriteLine(expr1);
Console.WriteLine(expr1.Substitute(y, 0));
Console.WriteLine(expr1.Substitute(y, 0).Evaled);
Console.WriteLine(expr1.Substitute(y, 0).Evaled == NaN);
Console.WriteLine("--------------------------------");
var expr2 = 5 + NaN;
Console.WriteLine(expr2);
Console.WriteLine(expr2.Evaled);
Console.WriteLine("--------------------------------");
var expr3 = Sin(NaN) / Cos(x) + y;
Console.WriteLine(expr3);
Console.WriteLine(expr3.Evaled);
Console.WriteLine("--------------------------------");
var expr4 = 10 * +oo;
Console.WriteLine(expr4);
Console.WriteLine("--------------------------------");
var expr5 = -oo * +oo;
Console.WriteLine(expr5);
Console.WriteLine("--------------------------------");
var expr6 = -oo / +oo;
Console.WriteLine(expr6);
Console.WriteLine("--------------------------------");
var expr7 = 50 / -oo;
Console.WriteLine(expr7);

Prints

sin(x) / y
sin(x) / 0
<h2>True
</h2>
5 + NaN
<h2>NaN
</h2>
sin(NaN) / cos(x) + y
<h2>NaN
</h2>
<h2>+oo
</h2>
<h2>-oo
</h2>
<h2>NaN
</h2>
0

See Entity.IsFinite for determining if there are NaNs or infinities inside an expression.

◆ pi

readonly Variable AngouriMath.MathS.pi = Variable.pi
static

The pi constant

There are multiple constants available. Examples:

var x = Var("x");
Console.WriteLine(e);
Console.WriteLine(e.Evaled);
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo));
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo).Simplify());
Console.WriteLine(Limit((1 + 1 / x).Pow(x), x, +oo).Simplify() == e);
Console.WriteLine("-----------------------");
Console.WriteLine(pi);
Console.WriteLine(pi.Evaled);
Console.WriteLine(Sin(pi / 3).Simplify());
Console.WriteLine(Cos(pi / 3).Simplify());
Console.WriteLine("-----------------------");
Console.WriteLine(i);
Console.WriteLine(4 + 3 * i);
Console.WriteLine("-----------------------");
Console.WriteLine(e.Pow(i * pi));
Console.WriteLine(e.Pow(i * pi).Simplify());

Prints

2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427
limit((1 + 1 / x) ^ x, x, +oo)
<h2>True
</h2>
pi
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068
sqrt(3) / 2
<h2>1/2
</h2>
i
<h2>4 + 3i
</h2>
e ^ (i * pi)
-1

◆ Variable

static AngouriMath.MathS.Variable
static

Creates two instances of Variable.

Creates three instances of Variable.

Returns
A tuple of 2 corresponding variable nodes

Here are multiple ways to create variables:

Entity.Variable x = "x";
var y = Var("y");
var (a, b) = Var("x", "y");
var (c, d, e) = Var("a", "b", "c");
var f = Var("f_1");
var alpha = Var("alpha");
var alphaPhi = Var("alpha_phi");
var alpha1 = Var("alpha_1");
var inGreek = Var("βγδεζη_кΨеВеТкΩ");
var inCyrillic = Var("Абаваола");

Underscore "_" allows indexing. Greek letter names (e. g. "alpha") will be latexised as Greek letter (but other than that, will appear as "alpha" in other places).

Returns
A tuple of 3 corresponding variable nodes

Here are multiple ways to create variables:

Entity.Variable x = "x";
var y = Var("y");
var (a, b) = Var("x", "y");
var (c, d, e) = Var("a", "b", "c");
var f = Var("f_1");
var alpha = Var("alpha");
var alphaPhi = Var("alpha_phi");
var alpha1 = Var("alpha_1");
var inGreek = Var("βγδεζη_кΨеВеТкΩ");
var inCyrillic = Var("Абаваола");

Underscore "_" allows indexing. Greek letter names (e. g. "alpha") will be latexised as Greek letter (but other than that, will appear as "alpha" in other places).

Returns
A tuple of 3 corresponding variable nodes

Here are multiple ways to create variables:

Entity.Variable x = "x";
var y = Var("y");
var (a, b) = Var("x", "y");
var (c, d, e) = Var("a", "b", "c");
var (c1, d1, e1, f1) = Var("c_1", "d_1", "e_1", "f_1");
var (c1, d1, e1, f1, g1) = Var("c_1", "d_1", "e_1", "f_1", "g_1");
var f = Var("f_1");
var alpha = Var("alpha");
var alphaPhi = Var("alpha_phi");
var alpha1 = Var("alpha_1");
var inGreek = Var("βγδεζη_кΨеВеТкΩ");
var inCyrillic = Var("Абаваола");

Underscore "_" allows indexing. Greek letter names (e. g. "alpha") will be latexised as Greek letter (but other than that, will appear as "alpha" in other places).


The documentation for this class was generated from the following files: