Skip to content

2.2.0 / Supports Complex numbers.

Compare
Choose a tag to compare
@AntonovAnton AntonovAnton released this 10 Oct 21:49
· 7 commits to main since this release
4fd4209

Improves:
Added support of complex numbers. #69

Complex numbers are written in the form a ± bi, where a is the real part and bi is the imaginary part.
Below is an example of evaluating a mathematical expression that contains complex numbers:

var expression = new MathExpression("sin(2 + 3i) * arctan(4i)/(1 - 6i)", new ComplexScientificMathContext());
var value = expression.EvaluateComplex();

Evaluation steps:

1: 3i = <0; 3>;
2: 2 + 3i = <2; 3>;
3: sin(2 + 3i) = <9.15449914691143; -4.168906959966565>;
4: 4i = <0; 4>;
5: arctan(4i) = <1.5707963267948966; 0.25541281188299525>;
6: sin(2 + 3i) * arctan(4i) = <15.444645882739138; -4.2103273709720295>;
7: 6i = <0; 6>;
8: 1 - 6i = <1; -6>;
9: sin(2 + 3i) * arctan(4i)/(1 - 6i) = <1.1001786515830083; 2.3907445385260218>; //completed