ComplexNum
A Typed Complex Number library implements mathematical functions for imaginary numbers.The Complex Class accept integers, floating-point numbers or complex numbers as arguments. Like Other Dart data types Complex class extends Object class
Features
polar coordinates
XPhaseXModulusXRectangular
Power and logarithmic functions
XExponentialXLog == LnXLog with base 10XSquare root
Trigonometric functions
XSineXCosineXTangentXInverse SineXInverse CosineXInverse Tangent
Hyperbolic functions
XHyperbolic sineXHyperbolic CosineXHyperbolic TangentXInverse Hyperbolic sineXInverse Hyperbolic CosineXInverse Hyperbolic Tangent
Classification functions
XFiniteXInfiniteXNaNXCloseness
Getting started
Initialization
final c1 = Complex(7, 5.5);
final c2 = Complex();
final c3 = Complex(5);
Ouputs
(7+5.5𝑖)
(0+0𝑖)
(5+0𝑖)
And the type is Detected autmaticly
Complex<int, double>
Complex<num, num>
Complex<int, num>
You can also explicitly define the type
final c = Complex<double, double>();
The output would be
(0+0.0𝑖)
Arithmetic operations
final c2 = Complex<int, double>() +
Complex(1, 5) * Complex<int, double>(3, 2) / Complex(10, 10);
Outputs
(0.5+1.2𝑖)
Other Operations
final c1 = Complex(7, 5.5).phase();
final c2 = Complex<int, double>(8, 3).exp();
final c3 = Complex(5, 2).cos();
final c4 = Complex(5, 2).sin();
Outputs
0.6659692373791098
(-2951.1260398524787+420.67281515745424𝑖)
(1.0671926518731156-3.4778844858991573𝑖)
(-3.6076607742131563+1.0288031496599335𝑖)
License
Libraries
- complex_num
- Support for doing something awesome.