Skip to content
pubscout

complex

0.8.0, released 2 years ago by an unverified publisher

A representation of a complex number with real and imaginary parts.

WASM-ready
$ flutter pub add complex
Source repository

What it does

Provides a class to represent complex numbers in Dart, translated from the Apache Commons Mathematics Library. It handles arithmetic operations, absolute values, conjugates, and exponential functions while correctly managing NaN and infinite values.

AI-written summary of version 0.8.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to perform mathematical calculations involving complex numbers.
  • You are porting mathematical algorithms from Java or the Apache Commons Math library to Dart.

Skip it when

  • You only need standard floating-point arithmetic without imaginary numbers.

Strengths

  • Handles NaN and infinite values according to consistent rules
  • Includes support for both Cartesian and Polar complex numbers
  • Compatible with Dart 3

Weaknesses

  • License is unknown
  • No topics specified

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
const z1 = Complex(1);
const z2 = Complex(3, 4);
print(z1.abs()); // 1.0
print(z2.abs()); // 5.0
print(z2.conjugate()); // (3.0, -4.0)

Alternatives

Packages that do the same job and could replace complex.

  • equations

    An equation-solving library supporting complex numbers, matrices, and numerical integration.

  • sortedmap

    A map of objects which can be sorted and filtered on both their key and value.

  • math_expressions

    Parse and evaluate mathematical expressions in real, vector, and interval contexts.

  • reflectable

    Provides runtime reflection via code generation with configurable capabilities.