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.4.tar.gz (5.4 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.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mathsym_adasneves-1.1.4.tar.gz
Algorithm Hash digest
SHA256 de1e4ddbfcd3e39ab3fa3c4b2b061ace3fb27fb826fcf4f801dadc954c8597c3
MD5 e0f475886fc6e0eeafdf53e03c0922c5
BLAKE2b-256 0b1163c24ae49b4b4682ae60afd24bf9b1adccdc22a923e6c2fdb91fbf1ca57b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mathsym_adasneves-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 aae2f2cfbc9bf705c2a8af47811554f0c9cc52a4f403ff8990db69d4379eaa70
MD5 115794e51d674239b782f037c607306a
BLAKE2b-256 2c0e8236b4772e425dd25b696e3c1e9a847240b0409422479efd3da11639f7b2

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