complex_num 1.0.0 copy "complex_num: ^1.0.0" to clipboard
complex_num: ^1.0.0 copied to clipboard

A typed complex number library that perform oprations on real and imaginary parts

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 #

  • Phase
  • Modulus
  • Rectangular

Power and logarithmic functions #

  • Exponential
  • Log == Ln
  • Log with base 10
  • Square root

Trigonometric functions #

  • Sine
  • Cosine
  • Tangent
  • Inverse Sine
  • Inverse Cosine
  • Inverse Tangent

Hyperbolic functions #

  • Hyperbolic sine
  • Hyperbolic Cosine
  • Hyperbolic Tangent
  • Inverse Hyperbolic sine
  • Inverse Hyperbolic Cosine
  • Inverse Hyperbolic Tangent

Classification functions #

  • Finite
  • Infinite
  • NaN
  • Closeness

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 #

BSD 3-clause license

4
likes
150
pub points
15%
popularity

Publisher

unverified uploader

A typed complex number library that perform oprations on real and imaginary parts

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on complex_num