A comprehensive JavaScript library for complex number arithmetic with a full suite of mathematical functions.
Complex.js is a JavaScript library for complex number arithmetic. It provides a complete set of functions for manipulating complex numbers, including basic arithmetic, trigonometric operations, and geometric transformations. It solves the problem of performing accurate complex number calculations in JavaScript environments.
JavaScript developers working on mathematical, scientific, or engineering applications that require complex number computations, such as signal processing, physics simulations, or computer graphics.
Developers choose Complex.js for its comprehensive function coverage, mathematical correctness, and predictable API that follows textbook conventions. It's well-tested, serves as the foundation for other math libraries, and is optimized for small bundle size.
The RAW Complex.js is a complex numbers library written in JavaScript
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes all elementary complex functions—arithmetic, trigonometric, hyperbolic, and inverses—making it suitable for advanced mathematical applications like signal processing or physics simulations.
Accepts complex numbers from strings, objects, arrays, or two numeric arguments, simplifying integration with various data sources and formats.
Supports rotation, scaling, translation, and distance calculations via complex arithmetic, enabling direct use in 2D graphics and geometric transformations.
Follows textbook conventions for functions and branch cuts, ensuring predictable API behavior and reliable results for educational or scientific use.
Optimized for compression with Google Closure Compiler, keeping the library lightweight and suitable for web applications where size matters.
Inverse trigonometric functions like acot have non-standard branch cuts that can cause unexpected jumps, as documented, requiring careful handling in sensitive applications.
The valueOf method returns null if the imaginary part is non-zero, which may break implicit type coercion in JavaScript and necessitate explicit real part extraction.
When parsing objects, additional attributes beyond 're' and 'im' are not preserved, forcing manual merging for extended data structures.
Lacks support for array or matrix operations on complex numbers, requiring manual loops for bulk processing, which can impact performance in data-intensive scenarios.