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.3.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.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mathsym_adasneves-1.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 8c5b6fc733a061463026038e922cd61150c9e713ccce7eac46fb8c3153ad30b8
MD5 f7d56a9ea05be97f2e1654683acd96d8
BLAKE2b-256 fc7f31be2927147a2156f1d84706d733ab4e52ebc99930d8ee050806c5aac097

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mathsym_adasneves-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a17d27462974a2c79444c2e1f88821ded9c5ff084d8b8740b4a20251b4e8bf94
MD5 363b00f64a23b5a5bf1ee94305113d99
BLAKE2b-256 5fdbf11c5d5da5aadffcc063e4440933dcb40bb8c337d20d26b893c760e84639

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