PyEVSpace Documentation#

The pyevspace module defines a vector and a matrix type to define a Euclidean vector space within Python projects. The Vector allows you to represent physical quantites like positions, velocities, accelerations and forces. The Matrix type allows us to represent idealized reference frames and to create linear transformations, most usefully pure rotations to move vectors between reference frames. A handful of module level functions for manipulating vectors and matrices are also available.

Note

The underlying data type of the internal array is a C type double. This obviously supports any type that can be represented as a Python float, which includes Python int types. Therefore numeric types are interpreted in the following order:

  1. floats are converted to a C double

  2. A conversion is attempted with the type’s __float__() method

  3. A conversion is attempted with the type’s __index__() method

  4. No suitable conversion can be made and a TypeError is raised

Therefore in this documentation a numeric type is any type that is either a float or int or can be converted to a float or int.

Available Types#

class pyevspace.Vector

A three-dimensional array object meant to represent a physical vector in a Euclidean vector space. The internal data buffer is a C type double, which supports numeric types.

class pyevspace.Matrix

A three by three-dimensional array object mean to represent a linear transformation of physical vectors in a Euclidean vector space. The internal data buffer is a C type double, which supports numeric types.

Module Functions#

Vector#

Matrix#