pythonic desmos
Project description
[!NOTE]
desmospy has these immediate goals:
- present the Desmos API with consistent terminology
- keep it simple, keep it pythonic
Basic usage is very simple. Create an instance of Calculator, then assign to one of its members.
from desmospy import Calculator
c = Calculator()
c.y = 1/2 * c.x + 3
c.show()
More advanced plots can be created with comparisons and the .set() method:
c.a = 0.3
a,x,y = c.a,c.x,c.y
c.set(y < a*x)
c.set(y >= a*x**2)
c.set(a*x*y == 1)
c.show()
Equations and inequalities can also be combined; first let's define two ellipse regions.
A = (x**2 / 49 + y**2 / 16 <= 1)
B = (x**2 / 16 + y**2 / 49 <= 1)
We can then take the union, also known as a logical OR | of the regions.
c.set(A | B)
c.show()
We can also take the intersection of the same regions, with the logical AND & operation.
c.set(A & B)
c.show()
This leaves the logical XOR ^ operation.
c.set(A ^ B)
c.show()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file desmospy-0.0.4.tar.gz.
File metadata
- Download URL: desmospy-0.0.4.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0e4278d342148a1d5aa27d36dad5aa6fcc6bc6f926d029bb2b9fea17458702e
|
|
| MD5 |
23bb551d4c7c6dcc509d3535f25cac13
|
|
| BLAKE2b-256 |
1534c87011753eb309719872eae14a0740b75b53fef77b87f46161d075f581bc
|
File details
Details for the file desmospy-0.0.4-py3-none-any.whl.
File metadata
- Download URL: desmospy-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ec3d0098090e3ce59d50c8af5a1526d8622c62879840ae226f1b76edd7bca0c
|
|
| MD5 |
125a7b62211e8c2911c291a5fdf6f76f
|
|
| BLAKE2b-256 |
c18b788e4cd5be2c8cfd5844ae49be0fc8ceb6162d9becc712ce67fddfc4225e
|