Unknown terms library for math apps
Project description
unknown-numbers
How do you use?
from package_name.alpha_term import *
# In this way, you can use every class on the package.
How do you install this package?
pip install unknown-terms
Quick Note: If you don't want this project as a package you had to change this lines in alpha_term.py
from .multiple_alpha_term import MultipleAlphaTerm
from .printer import TermPrinter
to
from multiple_alpha_term import MultipleAlphaTerm
from printer import TermPrinter
What does this repo do?
This repo allows you to create exponential terms using unknown numbers comfortably. You can do various math applications using this repository. Like binomial expansion, derivative, integral...
term1 = AlphaTerm(2, "x", 2) # That means 2x²
print(term1.get_coefficient()) # 2.0
print(term1.get_alpha()) # 'x'
print(term1.get_exponent()) # 2
print(term1.get_printable_exponent()) # ²
print(term1) # Irregular -> 2.0x²
print(TermPrinter.print(term1)) # Regular 2x²
AlphaTerm class has multiple methods.
term1 = AlphaTerm(2, "x", 2) # That means 2x²
term2 = term1 * 4 # That means 8x²
term3 = term2 ** 2 # That means 64x⁴
term4 = term1 * term2 * term3 # That means 1024x⁸
term5 = term4 / 8 # That means 128x⁸
What if the alphas are different ? The answer is in the MultipleAlphaTerm class.
term1 = AlphaTerm(3, "a", 4)
term2 = AlphaTerm(4, "b", 5)
m_term = term1 * term2 # This expression returns MultipleAlphaTerm(term1, term2)
print(m_term) # 12.0a⁴b⁵
print(TermPrinter.print(m_term)) # 12a⁴b⁵
- NOT: Operations such as exponentiation, division, multiplication can also be applied to objects in the MultipleAlpaTerm class.
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
Hashes for unknown_terms-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 970b57c1c95231b34dabf17faff779aafabfd1dd7d849838a53d974cef27e04f |
|
MD5 | 95f08978466a4853e10ecccf96eaa93d |
|
BLAKE2b-256 | 02b8d8c34161412bc39235b0969f639e44c91db0333f5db32d5743109844825e |