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.0.tar.gz (4.9 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.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for mathsym_adasneves-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a5623c8625a21fbde4ca0fdac3f6d8993cfa42512ac04def4f32fb8fcba6d1f1
MD5 b4b2399182b29d9624523109dee41051
BLAKE2b-256 91759ad808f52e28f21c355b0f4ed11c5042d5b53b499b9576f4ed59c102676c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mathsym_adasneves-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2d67c8495328963a62c5cec0e506d5e0d8839a0006f748fafcf5df3c0d24f83
MD5 275478de4be33f2fb81ff09cc7e86415
BLAKE2b-256 d9d7931393f7e679edb5255299927e7f5ea85c9235ad4eecd9058b1657d11797

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