You are looking at historical revision 21631 of this page. It may differ significantly from its current revision.


Quaternions are an extension to the number system: real numbers may be thought of as points on a line, complex numbers as points in a plane, and quaternion numbers as points in four-dimensional space.

Apart from mathematical curiosity, quaternions are useful for specifying rotations in three dimensional space (e.g. in this game), and also for image analysis.

An introduction to quaternions and this scheme library is available here.

Exported Procedures

[procedure] (make-rectangular )
[procedure] (make-polar )
[procedure] (real-part )
[procedure] (imag-part )
[procedure] (magnitude )
[procedure] (angle )
[procedure] (number? )
[procedure] (quaternion? )
[procedure] (= )
[procedure] (+ )
[procedure] (- )
[procedure] (* )
[procedure] (/ )
[procedure] (exp )
[procedure] (log )
[procedure] (expt )
[procedure] (sqrt )
[procedure] (sin )
[procedure] (cos )
[procedure] (tan )
[procedure] (asin )
[procedure] (acos )
[procedure] (atan )
[procedure] (jmag-part )
[procedure] (kmag-part )
[procedure] (vector-part )
[procedure] (colatitude )
[procedure] (longitude )
[procedure] (conjugate )
[procedure] (unit-vector )
[procedure] (dot-product )
[procedure] (cross-product )


The original version of this library was created by Dorai Sitaram.

This port to chicken scheme is by Peter Lane.


GPL version 3.0.

Version History

in progress.