Skip to main content

functional curve algebra (created by auxilium)

Project description

logo.png

Python Project curves

GitHubWorkflow Read the Docs GitHub GitHub release PyPI Version PyPI - Python Version PyPI Downloads

Introduction

To import the project simply type

>>> import curves

after installation.

The Curve class turns a function into an algebraic object which can handle operations like +, -, /, * as well es @.

>>> from curves import Curve

>>> eye = Curve()  # identity function
>>> eye(123.456)
123.456

>>> zero = Curve(0.0)
>>> zero(123.456)
0.0

>>> one = Curve(1.0)
>>> one(123.456)
1.0

>>> X = Curve('X')
>>> X
X

>>> p = 2 * X **2 + 3 * X + 1
>>> p
2 * X **2 + 3 * X + 1

>>> p(123.456)
30854.135872

>>> q = p(X - 1)
>>> q
(2 * X ** 2 + 3 * X + 1)(X - 1)

>>> q1 = p @ (X - 1)
>>> q1
(2 * X ** 2 + 3 * X + 1)(X - 1)

>>> q2 = 2 * (X - 1) ** 2 + 3 * (X - 1) + 1
>>> q2
2 * (X - 1) ** 2 + 3 * (X - 1) + 1

>>> q(123.456)
30359.311872

>>> q1(123.456)
30359.311872

>>> q2(123.456)
30359.311872

Documentation

More documentation available at https://curves.readthedocs.io

Install

The latest stable version can always be installed or updated via pip:

$ pip install curves

License

Code and documentation are available according to the license (see LICENSE file in repository).

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

curves-0.1.4.zip (20.2 kB view hashes)

Uploaded Source

Supported by

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