Skip to content

manakcodes/complex-calc-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

complex-calc-cpp

A minimal, lightweight, terminal based utility tool written in C++ to perform arithmetic and other advanced operations on complex numbers.


🐙 About

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.


🛸 Features

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


🏗️ Tools & Tech Used

C++gcc Bash VS CodeGitGitHub


⚙️ Project Requirements

  • C++17 compatible compiler

    • g++ (≥ 7.0 recommended)
    • clang++
    • MSVC (with C++17 support)
  • Terminal

    • ANSI-compatible terminal (for colored CLI output)

🛠️ Project Setup

1. Navigate To The Directory Where You Want To Clone The Project Repository (example: Desktop)

cd ~/Desktop

2. Clone the Project Repository

git clone https://github.com/manakcodes/complex-calc-cpp.git

3. Navigate To The Project Repository

cd path-to/complex-calc-cpp/

4. Run the following command (to build the project)

make

5. Run the following command (to run the project)

make run

6. After Using The Project Run The Following Command (to remove build artifacts)

make clean

📦 Using This As A Library

This project exposes a header-only complex number library. You can include it in your own C++ projects as follows:

Include the Library Header (From Your Path)

#include "include/complexcalcpp.hpp"

Usage Example

#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;
}

🌲 Project Tree

.
├── 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

🪪 LICENSE

This project is licensed under MIT License.


About

A minimal, lightweight, terminal based utility tool written in `C++` to perform arithmetic and other advanced operations on complex numbers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors