sot / Quaternion

Quaternion manipulation
https://sot.github.io/Quaternion
BSD 3-Clause "New" or "Revised" License
3 stars 7 forks source link

Provide ndarray-like methods in Quat #35

Open taldcroft opened 3 years ago

taldcroft commented 3 years ago

Currently an N-d Quat does not support basic things like index access, len(), iteration and so on.

At a minimum we should implement:

For a bit more investment of time, Astropy has a pretty nice formalism for implementing many of the ndarray methods via a mixin class. See: https://github.com/astropy/astropy/blob/e34ae450e61edafd88b58bb8da0124b961ab97c5/astropy/utils/shapes.py#L137.

An example of how this is used in practice is in the Time class. It is also used by coordinates, but that code is generally a lot more complex.