Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unknown-terms-1.0.0.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

unknown_terms-1.0.0-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page