https://github.com/bartwel27/cppmformulas
A cpp file program, filled with math formulas defined in cpp language Function
https://github.com/bartwel27/cppmformulas
cpp
Last synced: 10 months ago
JSON representation
A cpp file program, filled with math formulas defined in cpp language Function
- Host: GitHub
- URL: https://github.com/bartwel27/cppmformulas
- Owner: Bartwel27
- License: gpl-3.0
- Created: 2024-04-01T20:20:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-05T12:07:08.000Z (over 2 years ago)
- Last Synced: 2025-05-31T19:41:03.967Z (about 1 year ago)
- Topics: cpp
- Language: C++
- Homepage:
- Size: 111 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cppMFormulas
A cpp program filled with math formulas defined in functions and outputs returnable values, parameters are used to find a value of a formula, if a parameter has ```null``` value then it will find the ```null``` param given.

## 2D shapes
**_Square function_**
*Formula:*
> A = S²
The square function is a function that calculates and finds the area of a square and is measured in squre units ```m²```, the function takes 2 parametres the first param is ```A``` and last param is ```s²``` that stands for sides of a surface of a square, When finding the area as the first param please use the NULL value.
```
square(null, 3.20);
```
**_Rectangle function_**
*formula:*
> A = bh
The rectangle function is used to find the area of a rectangle, it takes 3 parametres, the first param is ```A```, second param ```b``` and third param is ```h```. if two params are given values, the function will use those values to find the other parameter.
```
rectangle(null, 36, 2);
```
**_Parallelogram function_**
*formula:*
> A = bh
The parallelogram function is much similar to the rectangle function as they both accept 3 parameters and uses them to find the area of a rectangle
```
parallelogram(null, 2, 2);
```
**_trapezoid function_**
*formula:*
> A = (a+b)h/2
The trapezoid function is a function that calculates the area of a trapezoid, basically is a quadrilateral that has at least one pair of parallel sides. The parallel sides are called the bases of the trapezoid. The trapezoid function takes 4 parameters and respectively these are ```A```, ```a```, ```b``` and ```h```.
```
trapezoid(null, 2, 3, 3);
```
**_triangle function_**
*formula:*
> A = 1 / 2 * bh
The triangle function calculates the area of a triangle and takes 3 parameters and respectively these params are ```A```, ```a``` and ```h```. To find the value of a parameter we use the ```null``` value.
```
triangle(null , 2, 4);
```
**_circle function_**
*formula:*
> A = πr²
The circle function calculates the area of a circle and accepts 2 parametres, the first and last param is ```A``` and ```r²``` respectively to find a value of a parameter we use the ```null``` value.
```
circle(NULL,3);
```
**_ellipse function_**
*formula:*
> A = πab
The Ellipse function calculates the area of a ellipse shape, and takes 3 parameters, the first second and third param is ```A```, ```a``` and ```b``` respectively, these paramaters can be found when we use the ```null``` value on a specific parameter.
```
ellipes(null, 2, 2);
```
>[!NOTE]
> Use ```null``` as a parameter to find its value.
>[!WARNING]
>Dont give all parameters values of a function to avoid false return outputs, You use the null value on a parameter to find a value of a same param.
### Installation
>folder
```
git clone https://github.com/bartwel27/cppMFormulas/
```
_& include in code_
```
#include "cppMFormulas/index.cpp"
```