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.5.zip (25.1 kB view details)

Uploaded Source

File details

Details for the file curves-0.1.5.zip.

File metadata

  • Download URL: curves-0.1.5.zip
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for curves-0.1.5.zip
Algorithm Hash digest
SHA256 43901c7225dcdd293949a9561d4a64cfec3d7ca3d645ddd9b61d697edc3402fa
MD5 f1dbe02c4af5b6378fe4ea334b533aa7
BLAKE2b-256 a04a345af6af3f116f0a2334223b8e321ba3dc943d3e479fcf7bd73380fd1c5e

See more details on using hashes here.

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