Skip to main content

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:

  • Print
  • 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()

Plot Result

If your program is working correctly, you should see something like the figure above.

More info

Github

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

mathsym_adasneves-1.1.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mathsym_adasneves-1.1.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file mathsym_adasneves-1.1.2.tar.gz.

File metadata

  • Download URL: mathsym_adasneves-1.1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for mathsym_adasneves-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1363d593359485d9775a7972400157aa7c88351a4a1c80ed6df52dae5969e84b
MD5 f70661a59ed57883bdc67febb570d10c
BLAKE2b-256 c8067453fc7186c98a606df6cab9905f49026b5e229d5c97cd7df12e9f74d4a6

See more details on using hashes here.

File details

Details for the file mathsym_adasneves-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mathsym_adasneves-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a35a258747ae8cd02707197ec6fdceb11ff936a9970e8fbdd9686b997f1ec0c
MD5 70e1459f8e5893660bdf5242c28ab625
BLAKE2b-256 2f98fad10bec92225987ec507cb2ba7e3329a38489fb155bb13f22ef409115ab

See more details on using hashes here.

Supported by

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