A minimal, lightweight, terminal based utility tool written in C++ to perform arithmetic and other advanced operations on complex numbers.
complex-calc-cpp is a minimal, lightweight, terminal-based calculator made using C++ for performing arithmetic and advanced mathematical operations on complex numbers.
It supports Cartesian Form (x + iy) and Polar Form (r β ΞΈ) and provides smooth menu based CLI interaction, colored output, and clean modular design.
Works in Two Representations
- Cartesian Form β
(x + iy) - Polar Form β
r β ΞΈ
| Arithmetic Operations |
|---|
Addition (+) |
Subtraction (-) |
Multiplication (*) |
Division (/) |
| Advanced Operations |
|---|
exponentiation or power (z, n) or ^ |
root extraction or n-roots (z, n) or β |
conjugate (~) |
-
β Auto-conversion
(Cartesian β Polar)or(Polar β Cartesian) -
ποΈ Display results in both form (Cartesian Form And Polar Form)
-
ποΈ Colored CLI output (ANSI)
-
β±οΈ Loading Animations (typing effect)
-
π¦ Clean header-based modular implementation
-
C++17 compatible compiler
g++(β₯ 7.0 recommended)clang++MSVC(withC++17support)
-
Terminal
- ANSI-compatible terminal (for colored CLI output)
cd ~/Desktopgit clone https://github.com/manakcodes/complex-calc-cpp.gitcd path-to/complex-calc-cpp/makemake runmake cleanThis project exposes a header-only complex number library. You can include it in your own C++ projects as follows:
#include "include/complexcalcpp.hpp"#include "include/complexcalcpp.hpp"
int main()
{
COMPLEX *A = new COMPLEX('A', 10.000, 20.000, MODE::CARTESIAN);
COMPLEX *B = new COMPLEX('B', 40.000, 60.000, MODE::CARTESIAN);
COMPLEX *sum = AddComplex(A, B);
COMPLEX *difference = SubtractComplex(A, B);
COMPLEX *product = MultiplyComplex(A, B);
COMPLEX *division = DivideComplex(A, B);
A->PrintComplex();
B->PrintComplex();
sum->PrintComplex();
difference->PrintComplex();
product->PrintComplex();
division->PrintComplex();
delete A;
delete B;
delete sum;
delete difference;
delete product;
delete division;
return 0;
}.
βββ include
β βββ complex.hpp
β βββ complexcalcpp.hpp <- API header
β βββ complexcore.hpp
β βββ utility
β βββ utility.hpp
βββ io
β βββ io.hpp
βββ Main.cpp <- entry point
βββ Makefile
βββ README.md <- you are here :)
βββ tests.cpp <- testing
4 directories, 9 files
This project is licensed under MIT License.