Quaternions.jl

A Julia package implementing quaternions.

Documentation

The documentation is still work in progress. For more information, see also

Feel free to open pull requests and improve this document!

Installation

pkg> add Quaternions

First example

julia> using Quaternions
julia> k = quat(0, 0, 0, 1)Quaternion{Int64}(0, 0, 0, 1)
julia> j = quat(0, 0, 1, 0)Quaternion{Int64}(0, 0, 1, 0)
julia> i = j*kQuaternion{Int64}(0, 1, 0, 0)
julia> i^2 == j^2 == k^2 == i*j*k == -1 # Similar to `im^2`.true
julia> 1 + i + k + j # Compatible with arithmetic operations as a `Number`.Quaternion{Int64}(1, 1, 1, 1)