Skip to content

amartinsmg/MathAlgorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

207 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mathematical Algorithms

This project provides a collection of mathematical algorithms implemented in C. It covers various mathematical calculations and operations, as well as geometric and statistical analyses. The goal of this project is to offer a comprehensive set of functions for performing common mathematical tasks.

Features

The project includes implementations of the following mathematical algorithms:

File Features
area_shape.h Area calculations for shapes such as triangles, squares, rectangles, diamonds, parallelograms, trapezoids, regular pentagons, circles, circular sectors, and ellipses
area_surface.h Surface area calculations for objects such as cubes, cuboids, prisms, regular prisms, pyramids, regular pyramids, cylinders, cones, and spheres
armstrong_numbers.h Armstrong number determination
basic_operations.h Basic operations, including rounding to a specified number of decimal places, nth root calculation, and logarithm calculation in a given base
combinatorics.h Combinatorial analysis, including permutation, circular permutation, arrangement, and combination
factorial.h Factorial calculation
gcd.h Greatest common divisor calculation
geometry.h Geometry-related functions, such as conversion between degrees and radians, distance between two points, midpoint between two points, slope of a line, angle of incline of a line, equation of a line, distance between a point and a line, circle perimeter calculation, number of diagonals in a polygon, sum of internal angles of a convex polygon, each internal angle of a regular polygon, and each external angle of a convex polygon
growth.h Growth calculations, including value after simple growth, rate of simple growth, value after compound growth, and rate of compound growth
happy_numbers.h Happy numbers determination
lcm.h Least common multiple calculation
percentage.h Percentage calculations, such as finding x percent of a number and determining what percentage one number represents of another
perfect_numbers.h Perfect numbers determination
prime_factorization.h Prime factorization of numbers
prime_numbers.h Prime numbers determination
probability_distribution.h Probability distributions, including binomial, Poisson, and Gaussian distributions
statistics.h Statistical analysis functions, such as mean, weighted mean, trimmed mean, geometric mean, harmonic mean, median, mode, maximum value, minimum value, range, midrange, variance, standard deviation, sample variance, and sample standard deviation
trigonometry.h Trigonometry functions, including calculation of the hypotenuse of a right triangle, calculation of a side of a right triangle, side calculation using the law of cosines, angle calculation using the law of cosines, side calculation using the law of sines, angle calculation using the law of sines
volume.h Volume calculations for objects such as cubes, cuboids, prisms, regular prisms, pyramids, regular pyramids, cylinders, cones, and spheres

The project aims to provide a comprehensive and efficient set of mathematical functions to assist in various calculations and analyses.

Getting Started

To compile and run the test file, follow these steps:

  1. Clone the repository:
git clone https://github.com/amartinsmg/MathAlgorithms.git
  1. Change to the project directory:
cd MathAlgorithms
  1. Build the test executable using the provided Makefile:
make test
  1. Execute the test program:
./debug/test

Usage

The test program provided allows you to evaluate the performance and correctness of the implemented mathematical algorithms. It calls each function and compares the results with pre-calculated values to validate the accuracy of the algorithms. By running the test program, you can ensure that the functions are functioning correctly and producing expected results.

Contributing

Contributions are welcome! If you find a bug or have a suggestion for an improvement, please open an issue or submit a pull request.

License

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

About

Math Algorithms in C language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors