Introduction

_images/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).