Python implementation of quaternions
Project description
pyquats package
Python implementation of quaternions is presented.
Modules
- pyquats.quats - Quat class
- pyquats.numpyquats - Quat class using numpy (slow)
- pyquats.qmath - mathematical functions for quaternions [sgn(q), exp(q), log(c), sin(q), cos(q), sinh(q), cosh(q)]
- pyquats.qtools - rotations, random unit quaternions
Download
To install an official release do
python3 -m pip install pyquats
To get the git version do
git clone https://github.com/ufkapano/pyquats.git
Usage
See doc/quickstart.txt
>>> from pyquats.quats import Quat
>>> ii = Quat(0, 1)
>>> jj = Quat(0, 0, 1)
>>> kk = Quat(0, 0, 0, 1)
>>> ii * jj == kk
True
>>> ii ** 2 == jj ** 2 == kk ** 2 == -1
True
>>> all(q.is_unit() for q in (Quat(1), ii, jj, kk))
True
>>> p = Quat(5.0, 2.5, -3.6, 4.9)
>>> p.conjugate()
Quat(5.0, -2.5, 3.6, -4.9)
>>> ~p
Quat(0.0732922896511287, -0.03664614482556435, 0.052770448548812667, -0.07182644385810613)
>>> p * ~p
Quat(1.0, 0.0, -2.7755575615628914e-17, 5.551115123125783e-17)
>>> list(p)
[5.0, 2.5, -3.6, 4.9]
Contributors
Andrzej Kapanowski (project leader)
Jan Ferdyan (quaternion functions)
References
[1] http://en.wikipedia.org/wiki/Quaternion
[2] Real Quaternionic Calculus Handbook, João Pedro Morais, Svetlin Georgiev, Wolfgang Sprößig, Birkhäuser Basel 2014.
EOF
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 pyquats-1.1.0.tar.gz.
File metadata
- Download URL: pyquats-1.1.0.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b4b44eda0622e830ced877d50d5b60033c55c089f64f6ab5ec3c14865083bc3
|
|
| MD5 |
1fd528e3809cc747b4a9c57e18295beb
|
|
| BLAKE2b-256 |
65109e86832b7c233891f7f296bb228829a5e9c7e3dde17d7576249957b6cc59
|
File details
Details for the file pyquats-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pyquats-1.1.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c5834cc5d955d851e972189e31fa97d5fb0cc5672f9331358c64c560e713e89
|
|
| MD5 |
87e1f1f342165d861452ce218f632eb9
|
|
| BLAKE2b-256 |
c2ae3aa9a693a955eccc5ffa08f4f9514789ede59a576d0cbdabfff310671a0e
|