https://github.com/JuliaGeometry/Quaternions.jl
A Julia implementation of quaternions
https://github.com/JuliaGeometry/Quaternions.jl
julia quaternion
Last synced: 8 months ago
JSON representation
A Julia implementation of quaternions
- Host: GitHub
- URL: https://github.com/JuliaGeometry/Quaternions.jl
- Owner: JuliaGeometry
- License: mit
- Created: 2013-12-16T22:00:25.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2024-05-06T16:16:53.000Z (about 1 year ago)
- Last Synced: 2024-05-08T21:21:15.224Z (about 1 year ago)
- Topics: julia, quaternion
- Language: Julia
- Homepage: https://juliageometry.github.io/Quaternions.jl
- Size: 925 KB
- Stars: 115
- Watchers: 31
- Forks: 38
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Quaternions.jl
A Julia implementation of quaternions.[](https://JuliaGeometry.github.io/Quaternions.jl/stable)
[](https://JuliaGeometry.github.io/Quaternions.jl/dev)
[](https://github.com/JuliaGeometry/Quaternions.jl/actions?query=workflow%3ACI+branch%3Amain)
[](https://codecov.io/gh/JuliaGeometry/Quaternions.jl)
[](https://github.com/JuliaTesting/Aqua.jl)[Quaternions](http://en.wikipedia.org/wiki/Quaternion) are best known for their suitability
as representations of 3D rotational orientation.
They can also be viewed as an extension of complex numbers.## First example
```julia
julia> using Quaternionsjulia> 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*k
Quaternion{Int64}(0, 1, 0, 0)julia> i^2 == j^2 == k^2 == i*j*k == -1 # Similar to `im^2`.
truejulia> 1 + i + k + j # Compatible with arithmetic operations as a `Number`.
Quaternion{Int64}(1, 1, 1, 1)
```Check out [the docs](https://juliageometry.github.io/Quaternions.jl) for further instructions.
In JuliaGeometry organization, there is also [Octonions.jl](https://github.com/JuliaGeometry/Octonions.jl) package.