KyPy
Python library containing many useful mathematical and scientific functions.
Functions
Mathematics
- Derivation
- Integration
- Prime Factorization
- Slope
- Quadratic Formula
- Evaluation
- Fibonacci Numbers
- Graphing functions and csv files
- Operations from text
- Solving functions
- Critical points
- More Coming Soon!
Science
- Ideal Gas Law
- Gravitational Potential Energy
- Force
- Acceleration
- More Coming Soon!
Getting Started
Install using PyPi (Linux instructions given)
- Open a terminal
- sudo pip3 install kypy
Install from source (Linux terminal and git)
- git clone https://github.com/kylecorry31/KyPy.git
- cd KyPy
- sudo python3 setup.py install
Install from source (tar file)
- Download the tar.gz file here.
- Extract the tar file
- Run setup.py with the parameter install
Example
import kypy.mathematics as math
import kypy.science as science
# Mathematics
a = math.create_variable(3, 2) # 3x^2
b = math.create_variable(4, 1) # 4x
c = math.create_variable(2, 0) # 2
f = math.create_function(a, b, c) # 3x^2 + 4x + 2
p1 = math.create_point(2, 4) # (2, 4)
p2 = math.create_point(3, 6) # (3, 6)
f2 = math.str_to_fn('x^2 - 4x -4')
print(a)
print(b)
print(c)
print(f)
print(math.evaluate(f, 5))
print(math.derivative(f))
print(math.integrate(f, 4, 10))
print("Factors of 8:", math.prime_factor(8))
print("Slope:", math.slope(p1, p2))
math.plot(f, -100, 100)
print(math.zeros(f2))
# Science
print("Force:", science.force(10, 2))
print("Temperature:", science.ideal_gas_law(10, 10, 4))