/SimpleMath

A C++ library providing basic arithmetic operations, trigonometric functions, and advanced mathematical functions.

Primary LanguageC++MIT LicenseMIT

🎉 SimpleMath Library 🎉

Build Status License

Welcome to SimpleMath, a C++ library providing basic arithmetic operations, trigonometric functions, and advanced mathematical functions. 🌟

📚 Features

  • 🔢 Basic arithmetic operations: add, subtract, multiply, divide
  • 📐 Trigonometric functions: sine, cosine, tangent
  • 🚀 Advanced mathematical functions: power, squareRoot

📂 Project Structure

SimpleMath/
├── include/
│   └── simplemath.h       <-- Header file
├── src/
│   └── simplemath.cpp     <-- Source file
├── tests/
│   └── main.cpp           <-- Test program
├── CMakeLists.txt         <-- CMake configuration file
└── README.md              <-- Project documentation

🚀 Getting Started

Follow these steps to get started with the SimpleMath library:

  1. Clone the Repository
git clone https://github.com/EchoSingh/SimpleMath.git
cd SimpleMath
  1. Create a Build Directory
mkdir build
cd build
  1. Generate Build Files with CMake
cmake ..
  1. Build Your Project
cmake --build .
  1. Run the Test Program
./test_program

📄 Example Usage

Here's an example of how to use the SimpleMath library:

#include <iostream>
#include "simplemath.h"

int main() {
    using namespace SimpleMath;

    std::cout << "5 + 3 = " << add(5, 3) << std::endl;
    std::cout << "5 - 3 = " << subtract(5, 3) << std::endl;
    std::cout << "5 * 3 = " << multiply(5, 3) << std::endl;
    std::cout << "5 / 3 = " << divide(5, 3) << std::endl;

    std::cout << "sin(30) = " << sine(30 * M_PI / 180) << std::endl;
    std::cout << "cos(30) = " << cosine(30 * M_PI / 180) << std::endl;
    std::cout << "tan(30) = " << tangent(30 * M_PI / 180) << std::endl;

    std::cout << "2^3 = " << power(2, 3) << std::endl;
    std::cout << "sqrt(16) = " << squareRoot(16) << std::endl;

    return 0;
}

output :-

output

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.