3d math including quaternions/euler angles/dcms and utility functions

Version on this page:
LTS Haskell 21.25:
Stackage Nightly 2023-06-21:
Latest on Hackage:

See all snapshots spatial-math appears in

BSD-3-Clause licensed by Greg Horn
Maintained by [email protected]
This version can be pinned in stack with:spatial-math-,1720

Module documentation for

Used by 2 packages in lts-21.25(full list with versions):


Hackage Build Status

3d math including quaternions/euler angles/dcms and utility functions.

This is a port of my ‘mathlib’ C library: and may someday be merged with it.


- convert to using `linear` V3, M33, Quaternion types
- doctests
- fix long unknown bug: rotateXyzAbout{X,Y,Z} was rotating opposite direction from intended
- Serialize a => Serialize (Euler a)
- Binary a => Binary (Euler a)

- add Ord instances

- instance Applicative Euler
- specialized dcmOfEuler321 without Ord constraint

- use ArcTan2 instead of RealFloat
- unsafe specialized euler321OrDcm without Ord constraint
- primitive implementation of quatOfDcm