No project description provided
Project description
Math Library - Python
This repository contains a comprehensive Python library for performing various mathematical operations, ranging from basic arithmetic to advanced algebra, trigonometry, and geometry. Designed for ease of use, the library is ideal for students, educators, and developers seeking an all-in-one math toolkit.
Features
Arithmetic Operations
- Addition (
add(a, b)): Returns the sum of two numbers. - Subtraction (
subtract(a, b)): Returns the difference of two numbers. - Multiplication (
multiply(a, b)): Returns the product of two numbers. - Division (
divide(a, b)): Returns the quotient of two numbers (raises an error for division by zero). - Modulus (
modulus(a, b)): Returns the remainder of the division of two numbers.
Algebraic Functions
- Power (
power(a, b)): Calculates . - Square Root (
sq_root(x)): Computes the square root of a number. - Cube Root (
cu_root(x)): Computes the cube root of a number. - Absolute Value (
absolute_v(x)): Returns the absolute value of a number. - Factorial (
factorial(n)): Returns . - Fibonacci Sequence (
fibonacci(n)): Computes the nth Fibonacci number. - Prime Checking (
is_prime(n)): Checks whether a number is prime. - Nth Prime (
nth_prime(n)): Finds the nth prime number. - GCD (
gcd(a, b)): Calculates the greatest common divisor of two numbers. - LCM (
lcm(a, b)): Calculates the least common multiple of two numbers.
Trigonometry Functions
- Sine (
sine(angle_in_degrees)): Calculates the sine of an angle (in degrees). - Cosine (
cosine(angle_in_degrees)): Calculates the cosine of an angle (in degrees). - Tangent (
tangent(angle_in_degrees)): Calculates the tangent of an angle (in degrees). - Arcsine (
arcsine(value)): Calculates the arcsine in degrees. - Arccosine (
arccosine(value)): Calculates the arccosine in degrees. - Arctangent (
arctangent(value)): Calculates the arctangent in degrees. - Hyperbolic Sine, Cosine, Tangent: Computes hyperbolic trigonometric functions.
Statistical Functions
- Mean (
mean(numbers)): Returns the average of a list of numbers. - Median (
median(numbers)): Returns the median value of a list of numbers. - Mode (
mode(numbers)): Returns the most frequent value in a list. - Range (
range_of_list(numbers)): Calculates the range (max - min) of a list.
Geometry Functions
- Area of Circle (
area_of_circle(radius)): Computes the area of a circle. - Circumference of Circle (
circumference_of_circle(radius)): Computes the circumference of a circle. - Area of Triangle (
area_of_triangle(base, height)): Computes the area of a triangle. - Perimeter of Triangle (
perimeter_of_triangle(a, b, c)): Computes the perimeter of a triangle. - Area of Rectangle (
area_of_rectangle(length, width)): Computes the area of a rectangle. - Perimeter of Rectangle (
perimeter_of_rectangle(length, width)): Computes the perimeter of a rectangle. - Volume and Surface Area of 3D Shapes: Functions to compute the volume and surface area of spheres, cylinders, cubes, and rectangular prisms.
Utility Functions
- Conversion: Degrees to radians and vice versa.
- Factorization (
factors(n)): Returns a list of all factors of a number. - Perfect Numbers: Check for perfect squares and perfect cubes.
- Summation: Calculate the sum of all, even, or odd numbers up to .
Installation
pip install math-kit-L
# Import the library
from math_library import *
# Example usage
print(add(10, 5)) # Output: 15
print(area_of_circle(7)) # Output: 153.93804002589985
Usage
Example Code
# Arithmetic
print(add(5, 3)) # Output: 8
print(divide(10, 2)) # Output: 5.0
# Geometry
radius = 10
print(f"Area of Circle: {area_of_circle(radius)}")
print(f"Circumference: {circumference_of_circle(radius)}")
# Algebra
n = 5
print(f"Factorial of {n}: {factorial(n)}")
print(f"Fibonacci({n}): {fibonacci(n)}")
# Trigonometry
angle = 30
print(f"Sine of {angle}: {sine(angle)}")
print(f"Cosine of {angle}: {cosine(angle)}")
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Created by lmc.
Acknowledgments
Special thanks to Python's math and cmath libraries for providing foundational functions and inspiration for this library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file math_kit_l-0.4.0.tar.gz.
File metadata
- Download URL: math_kit_l-0.4.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81e9ec577e5902770b6089e1e479ab21cd7535c5d6a8d1eb04725058738953e7
|
|
| MD5 |
55c2e524e87413be74b6e1d1ae1f0c0f
|
|
| BLAKE2b-256 |
5bf65e4fa6e2ea0602bd490cbdb6e4210734ba0e0c63e6ee1d8e81952b53e3bd
|
File details
Details for the file math_kit_L-0.4.0-py3-none-any.whl.
File metadata
- Download URL: math_kit_L-0.4.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b718c604e455f657a7d2a2ad0aa8bd7a730af0588aec7089c80b52f46abb9a8
|
|
| MD5 |
d617b4bb923b3e494250d41777f8e6f7
|
|
| BLAKE2b-256 |
dc5ab79edf32f1cd2dae959f9c79cc09f265d8d86fb628fd93542e76edb520fe
|