Skip to content
A simple python vector mathematics module
Python
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pyclid
readme Added documentation for quaternions Jun 28, 2016
LICENSE Initial commit Nov 12, 2015
MANIFEST Updated readme to include vector subpage Jun 27, 2016
README.md Updated readme to include vector subpage Jun 27, 2016
setup.cfg Added setup.cfg Nov 12, 2015
setup.py Changed print output of vectors to use <x, y> in place of [x, y] Jun 23, 2016

README.md

Pyclid

A simple mathematics module supporting Vectors, Matrices and Quaternions.

Vectors

Current available vector classes are the Vec2, Vec3 and Vec4 classes. See the vectors page for details on class functionality.

>>> import pyclid
>>> pyclid.Vec2()
<0, 0>
>>> pyclid.Vec3()
<0, 0, 0>
>>> pyclid.Vec4()
<0, 0, 0, 0>

Matrices

Current available matrix classes are the Mat2, Mat3 and Mat4 classes. The classes support standard matrix algebra as well advanced formula used for graphical calculations. Currently the Mat3 and Mat4 are subject to change, since there is still a design decision to be made over their compatibility with Vec3 and Vec4 classes for graphical use (i.e. Vec3 used with a Mat4 rotation matrix). Current functionality can be found on the matrices readme.

>>> pyclid.Mat2()
| 0 0 |
| 0 0 |
>>> pyclid.Mat3()
| 0 0 0 |
| 0 0 0 |
| 0 0 0 |
>>> pyclid.Mat4()
| 0 0 0 0 |
| 0 0 0 0 |
| 0 0 0 0 |
| 0 0 0 0 |

Quaternions

Limited support is currently available for quaternions. Currently there is a single Quaternion class (Quat), and contains four parameters (q0, q1, q2 and q3). Few functions have been added for the quaternion class and is very much a work in progress. Current functionality can be found on the quaternions readme.

>>> python.Quat()
<0, 0, 0, 0>
You can’t perform that action at this time.