A small example package
Project description
Basic Math Library
This package provides users with a basic interface for evaluating functions.
Usage
from symMath_adasneves127.equation import create_eq
eq = create_eq("5x^2 + 3x + 5")
eq.evaluate(4) # Evaluate the equation when x=4
eq.evaluate(7.21) # Evaluate the equation when x=7.21
The 'equation' function will prvide an object with the following methods for use:
- Evaluate
Print will print out how the program interpreted the equation given.
Evaluate takes in a parameter 'x', to be used as the variable placeholder.
Implementation with matplotlib
# Import the required libraries and functions
from symMath_adasneves127.equation import create_eq
from matplotlib import pyplot as plt
# Create a basic equation of x^2
equation = create_eq("x^2")
# Unfortunately, the 'Range' function does not support floating point step values.
x = -10
while x < 10:
y = equation.evaluate(x) # Evaluate, plot, increment.
plt.plot(x, y, 'ro')
x += 0.1
# Show the plot
plt.show()
If your program is working correctly, you should see something like the figure above.
More info
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 mathsym_adasneves-1.1.0.tar.gz.
File metadata
- Download URL: mathsym_adasneves-1.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5623c8625a21fbde4ca0fdac3f6d8993cfa42512ac04def4f32fb8fcba6d1f1
|
|
| MD5 |
b4b2399182b29d9624523109dee41051
|
|
| BLAKE2b-256 |
91759ad808f52e28f21c355b0f4ed11c5042d5b53b499b9576f4ed59c102676c
|
File details
Details for the file mathsym_adasneves-1.1.0-py3-none-any.whl.
File metadata
- Download URL: mathsym_adasneves-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d67c8495328963a62c5cec0e506d5e0d8839a0006f748fafcf5df3c0d24f83
|
|
| MD5 |
275478de4be33f2fb81ff09cc7e86415
|
|
| BLAKE2b-256 |
d9d7931393f7e679edb5255299927e7f5ea85c9235ad4eecd9058b1657d11797
|